File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,19 @@ export class PfLabelGroup extends LitElement {
103103
104104 @query ( '#close-button' ) private _button ?: HTMLButtonElement ;
105105
106- @queryAssignedNodes ( {
107- slot : 'category' ,
108- flatten : true ,
109- } )
110- private _categorySlotted ?: HTMLElement [ ] ;
106+ private get _categorySlotted ( ) : HTMLElement [ ] {
107+ const isServer = typeof window === 'undefined' || ! ( 'document' in globalThis ) ;
108+ if ( isServer ) {
109+ return [ ] ;
110+ }
111+
112+ const slot = this . shadowRoot ?. querySelector < HTMLSlotElement > ( 'slot[name="category"]' ) ;
113+ if ( ! slot ) {
114+ return [ ] ;
115+ }
116+
117+ return slot . assignedElements ( { flatten : true } ) as HTMLElement [ ] ;
118+ }
111119
112120 get #labels( ) : NodeListOf < PfLabel > | PfLabel [ ] {
113121 if ( isServer ) {
@@ -207,7 +215,7 @@ export class PfLabelGroup extends LitElement {
207215 this . open = ! this . open ;
208216 await this . updateComplete ;
209217 this . labelsChanged ( ) ;
210- const overflow = this . renderRoot . querySelector ( '#overflow' ) as PfLabel | null ;
218+ const overflow = isServer ? null : this . renderRoot . querySelector ( '#overflow' ) as PfLabel | null ;
211219 if ( overflow ) {
212220 this . #tabindex. atFocusedItemIndex = this . #tabindex. items . indexOf ( overflow ) ;
213221 }
You can’t perform that action at this time.
0 commit comments