File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -608,6 +608,14 @@ label {
608608 display : none;
609609}
610610
611+ .ghb-item-collapsed > .ghb-children {
612+ display : none !important ;
613+ }
614+
615+ .ghb-item-open > .ghb-children {
616+ display : block !important ;
617+ }
618+
611619.ghb-selection {
612620 margin-top : 0.85rem ;
613621 border : 1px solid # 2f3b5e ;
Original file line number Diff line number Diff line change 166166
167167 const itemEl = document . createElement ( "div" ) ;
168168 itemEl . className = "ghb-item" ;
169+ if ( isFolder ) {
170+ itemEl . classList . add ( isOpen ? "ghb-item-open" : "ghb-item-collapsed" ) ;
171+ }
169172
170173 const rowEl = document . createElement ( "div" ) ;
171174 rowEl . className = `ghb-row ghb-row-${ node . type } ` ;
201204 const childrenEl = document . createElement ( "div" ) ;
202205 childrenEl . className = "ghb-children" ;
203206 childrenEl . hidden = ! isOpen ;
207+ childrenEl . style . display = isOpen ? "block" : "none" ;
204208 childrenEl . setAttribute ( "role" , "group" ) ;
205209 node . children . forEach ( ( child ) => {
206210 childrenEl . appendChild ( createTreeNode ( child , depth + 1 , expandAll ) ) ;
246250 const nextExpanded = ! isExpanded ;
247251 rowEl . setAttribute ( "aria-expanded" , String ( nextExpanded ) ) ;
248252 childrenEl . hidden = ! nextExpanded ;
253+ childrenEl . style . display = nextExpanded ? "block" : "none" ;
254+ itemEl . classList . remove ( "ghb-item-open" , "ghb-item-collapsed" ) ;
255+ itemEl . classList . add ( nextExpanded ? "ghb-item-open" : "ghb-item-collapsed" ) ;
249256
250257 const twistyEl = rowEl . querySelector ( ".ghb-twisty" ) ;
251258 if ( twistyEl ) twistyEl . textContent = nextExpanded ? "-" : "+" ;
You can’t perform that action at this time.
0 commit comments