Skip to content

Commit 728389f

Browse files
committed
fix(label-group): guard querySelectorAll for SSR
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fea628a commit 728389f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

elements/pf-label-group/pf-label-group.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { classMap } from 'lit/directives/class-map.js';
88
import { observes } from '@patternfly/pfe-core/decorators/observes.js';
99
import { RovingTabindexController } from '@patternfly/pfe-core/controllers/roving-tabindex-controller.js';
1010

11+
import { isServer } from 'lit';
12+
1113
import { PfLabel } from '../pf-label/pf-label.js';
1214

1315
import styles from './pf-label-group.css';
@@ -91,7 +93,10 @@ export class PfLabelGroup extends LitElement {
9193

9294
@queryAssignedNodes({ slot: 'category', flatten: true }) private _categorySlotted?: Node[];
9395

94-
get #labels(): NodeListOf<PfLabel> {
96+
get #labels(): NodeListOf<PfLabel> | PfLabel[] {
97+
if (isServer) {
98+
return [] as PfLabel[];
99+
}
95100
return this.querySelectorAll<PfLabel>('pf-label:not([slot]):not([overflow-label])');
96101
}
97102

0 commit comments

Comments
 (0)