mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-22 00:19:40 +08:00
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:
@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user