File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/kit-headless/src/components/popover Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,6 @@ type PopoverTriggerProps = {
8
8
} & QwikIntrinsicElements [ 'button' ] ;
9
9
10
10
export function usePopover ( popovertarget : string ) {
11
- /* NEEDS TO RUN BEFORE POLYFILL LOAD, ALSO ONLY DYNAMIC IMPORT */
12
- const isSupported =
13
- typeof HTMLElement !== 'undefined' &&
14
- typeof HTMLElement . prototype === 'object' &&
15
- 'popover' in HTMLElement . prototype ;
16
-
17
11
const hasPolyfillLoadedSig = useSignal < boolean > ( false ) ;
18
12
const didClickSig = useSignal < boolean > ( false ) ;
19
13
@@ -23,6 +17,12 @@ export function usePopover(popovertarget: string) {
23
17
} ) ;
24
18
25
19
const initPopover$ = $ ( async ( ) => {
20
+ /* needs to run before poly load */
21
+ const isSupported =
22
+ typeof HTMLElement !== 'undefined' &&
23
+ typeof HTMLElement . prototype === 'object' &&
24
+ 'popover' in HTMLElement . prototype ;
25
+
26
26
if ( ! hasPolyfillLoadedSig . value && ! isSupported ) {
27
27
await loadPolyfill$ ( ) ;
28
28
hasPolyfillLoadedSig . value = true ;
You can’t perform that action at this time.
0 commit comments