fix(core): prevent iOS views to be measured if no native view

This should not happen but it does. Did not manage to find the real source but it seems ok to test it here. Plus if it happens the measurement chain for that view will be broken
This commit is contained in:
Martin Guillon
2021-08-16 14:36:27 +02:00
parent 4faca3a9bc
commit 4e97e71da2

View File

@ -92,7 +92,7 @@ export class View extends ViewCommon implements ViewDefinition {
public measure(widthMeasureSpec: number, heightMeasureSpec: number): void { public measure(widthMeasureSpec: number, heightMeasureSpec: number): void {
const measureSpecsChanged = this._setCurrentMeasureSpecs(widthMeasureSpec, heightMeasureSpec); const measureSpecsChanged = this._setCurrentMeasureSpecs(widthMeasureSpec, heightMeasureSpec);
const forceLayout = (this._privateFlags & PFLAG_FORCE_LAYOUT) === PFLAG_FORCE_LAYOUT; const forceLayout = (this._privateFlags & PFLAG_FORCE_LAYOUT) === PFLAG_FORCE_LAYOUT;
if (forceLayout || measureSpecsChanged) { if (this.nativeViewProtected && (forceLayout || measureSpecsChanged)) {
// first clears the measured dimension flag // first clears the measured dimension flag
this._privateFlags &= ~PFLAG_MEASURED_DIMENSION_SET; this._privateFlags &= ~PFLAG_MEASURED_DIMENSION_SET;