@@ -2011,13 +2011,14 @@ pub(crate) fn screen_size_bp_to_key(breakpoint: ScreenSizeBp) -> StyleKey {
20112011 }
20122012}
20132013
2014+ /// the bool in the return is a classes_applied flag. if a new class has been applied, we need to do a request_style_recursive
20142015pub ( crate ) fn resolve_nested_maps (
20152016 style : Style ,
20162017 interact_state : & InteractionState ,
20172018 screen_size_bp : ScreenSizeBp ,
20182019 classes : & [ StyleClassRef ] ,
20192020 context : & mut Style ,
2020- ) -> Style {
2021+ ) -> ( Style , bool ) {
20212022 // Start with depth 0 for the initial call
20222023 resolve_nested_maps_internal ( style, interact_state, screen_size_bp, context, classes, 0 )
20232024}
@@ -2029,13 +2030,14 @@ fn resolve_nested_maps_internal(
20292030 context : & mut Style ,
20302031 classes : & [ StyleClassRef ] ,
20312032 depth : u32 ,
2032- ) -> Style {
2033+ ) -> ( Style , bool ) {
20332034 const MAX_DEPTH : u32 = 6 ;
20342035 if depth >= MAX_DEPTH {
2035- return style;
2036+ return ( style, false ) ;
20362037 }
20372038
20382039 let mut changed = false ;
2040+ let mut classes_applied = false ;
20392041
20402042 let old_style = style. clone ( ) ;
20412043 style = style. apply_classes_from_context ( classes, context) ;
@@ -2044,6 +2046,7 @@ fn resolve_nested_maps_internal(
20442046 context. remove_nested_map ( class. key ) ;
20452047 }
20462048 changed = true ;
2049+ classes_applied = true ;
20472050 }
20482051
20492052 // Apply context mappings first
@@ -2153,17 +2156,19 @@ fn resolve_nested_maps_internal(
21532156
21542157 // Recurse once at the end if anything changed
21552158 if changed && depth + 1 < MAX_DEPTH {
2156- style = resolve_nested_maps_internal (
2159+ let ( new_style , recursive_classes_applied ) = resolve_nested_maps_internal (
21572160 style,
21582161 interact_state,
21592162 screen_size_bp,
21602163 context,
21612164 classes,
21622165 depth + 1 ,
21632166 ) ;
2167+ style = new_style;
2168+ classes_applied |= recursive_classes_applied;
21642169 }
21652170
2166- style
2171+ ( style, classes_applied )
21672172}
21682173
21692174#[ derive( Default , Clone ) ]
0 commit comments