mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Avoid applying CSS multiple times (#4784)
* Move the applyStyleFromScope to onLoaded, when the views are created and id or className properties are set the CSS selectors are queried and applied multiple times * Condense the changes when applying properties
This commit is contained in:
committed by
SvetoslavTsenov
parent
b0577728be
commit
6d7c1ff295
@@ -125,12 +125,6 @@ const applyComponentCss = profile("applyComponentCss", (instance: View, moduleNa
|
||||
cssApplied = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cssApplied) {
|
||||
// Called only to apply application css.
|
||||
// If we have page css (through file or cssAttribute) we have appCss applied.
|
||||
(<any>instance)._refreshCss();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -211,13 +205,7 @@ export function setPropertyValue(instance: View, instanceModule: Object, exports
|
||||
instance[propertyName] = exports[propertyValue];
|
||||
}
|
||||
else {
|
||||
let attrHandled = false;
|
||||
if (!attrHandled && instance._applyXmlAttribute) {
|
||||
attrHandled = instance._applyXmlAttribute(propertyName, propertyValue);
|
||||
}
|
||||
if (!attrHandled) {
|
||||
instance[propertyName] = propertyValue;
|
||||
}
|
||||
instance[propertyName] = propertyValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user