Skip to content

Commit 08e73b3

Browse files
author
Nedyalko Nikolov
committed
Fixed style scope.
1 parent 35b0f24 commit 08e73b3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tns-core-modules/ui/styling/style-scope.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ export function applyInlineStyle(view: ViewBase, style: string) {
264264
let inlineRuleSet = StyleScope.createSelectorsFromCss(localStyle, null, {});
265265
let inlineSelector = new InlineSelector(inlineRuleSet[0]);
266266
view.inlineStyleSelector = inlineSelector;
267-
view._cssState.apply();
267+
if (view._cssState) {
268+
view._cssState.apply();
269+
} else {
270+
let styleScope = new StyleScope();
271+
styleScope.applySelectors(view);
272+
}
268273
} catch (ex) {
269274
traceWrite("Applying local style failed: " + ex, traceCategories.Error, traceMessageType.error);
270275
}

0 commit comments

Comments
 (0)