Skip to content

Commit 43b97bf

Browse files
committed
fix(core): make internals controller ssrable
safari detector (predictably) breaks everyone else
1 parent bce98d2 commit 43b97bf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/thin-aliens-smoke.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/pfe-core": patch
3+
---
4+
`InternalsController`: prevent Safari-detector from breaking SSR

core/pfe-core/controllers/internals-controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export class InternalsController implements ReactiveController, ARIAMixin {
8383
return Array.from(this.instances.get(host)?.internals.labels ?? []) as Element[];
8484
}
8585

86-
public static isSafari: boolean = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
86+
public static isSafari: boolean =
87+
!isServer && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
8788

8889
public static of(
8990
host: ReactiveControllerHost,

0 commit comments

Comments
 (0)