File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1426,6 +1426,23 @@ export function test_UsingSameSelectorsWithSpecific_ShouldApplyLatest() {
14261426 }
14271427 helper . buildUIAndRunTest ( testButton , testFunc , testCss ) ;
14281428}
1429+
1430+ export function test_CascadingClassNamesAppliesAfterPageLoad ( ) {
1431+ const stack = new stackModule . StackLayout ( ) ;
1432+ const label = new labelModule . Label ( ) ;
1433+ label . text = "Some text" ;
1434+ label . cssClass = 'lab1' ;
1435+ stack . addChild ( label ) ;
1436+
1437+ application . addCss ( ".added { background-color: red; } .added .lab1 { background-color: blue; } .lab1 { color: red}" ) ;
1438+
1439+ helper . buildUIAndRunTest ( stack , function ( views : Array < viewModule . View > ) {
1440+ helper . assertViewColor ( label , "#FF0000" ) ;
1441+ stack . className = "added" ;
1442+ helper . assertViewBackgroundColor ( label , "#0000FF" ) ;
1443+ helper . assertViewBackgroundColor ( stack , "#FF0000" ) ;
1444+ } ) ;
1445+ }
14291446// <snippet module="ui/styling" title="styling">
14301447// For information and example how to use style properties please refer to special [**Styling**](../../../styling.md) topic.
14311448// </snippet>
Original file line number Diff line number Diff line change @@ -614,6 +614,10 @@ export class View extends ProxyObject implements definition.View {
614614 if ( metadata . affectsStyle ) {
615615 this . style . _resetCssValues ( ) ;
616616 this . _applyStyleFromScope ( ) ;
617+ this . _eachChildView ( ( v ) => {
618+ v . _checkMetadataOnPropertyChanged ( metadata ) ;
619+ return true ;
620+ } ) ;
617621 }
618622 }
619623
You can’t perform that action at this time.
0 commit comments