File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
packages/kit-headless/src/components Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,13 @@ export const ComboboxTrigger = component$((props: ComboboxTriggerProps) => {
18
18
return (
19
19
< PopoverTrigger
20
20
{ ...props }
21
+ disableClickInitPopover = { true }
21
22
ref = { context . triggerRef }
22
- onMouseDown $= { [
23
+ onClick $= { [
23
24
$ ( ( ) => {
24
25
context . isListboxOpenSig . value = ! context . isListboxOpenSig . value ;
25
26
} ) ,
26
- props . onMouseDown $,
27
+ props . onClick $,
27
28
] }
28
29
tabIndex = { - 1 }
29
30
aria-haspopup = "listbox"
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { isBrowser } from '@builder.io/qwik/build';
4
4
5
5
type PopoverTriggerProps = {
6
6
popovertarget : string ;
7
+ disableClickInitPopover : boolean ;
7
8
// TODO anchor for floatingui
8
9
// TODO toggle? on/off?
9
10
} & QwikIntrinsicElements [ 'button' ] ;
@@ -87,7 +88,7 @@ export function usePopover(popovertarget: string) {
87
88
}
88
89
89
90
export const PopoverTrigger = component$ < PopoverTriggerProps > (
90
- ( { popovertarget, ...rest } : PopoverTriggerProps ) => {
91
+ ( { popovertarget, disableClickInitPopover = false , ...rest } : PopoverTriggerProps ) => {
91
92
const { initPopover$ } = usePopover ( popovertarget ) ;
92
93
93
94
return (
@@ -97,9 +98,11 @@ export const PopoverTrigger = component$<PopoverTriggerProps>(
97
98
popovertarget = { popovertarget }
98
99
onClick$ = { [
99
100
rest . onClick$ ,
100
- $ ( ( ) => {
101
- initPopover$ ( ) ;
102
- } ) ,
101
+ ! disableClickInitPopover
102
+ ? $ ( ( ) => {
103
+ initPopover$ ( ) ;
104
+ } )
105
+ : undefined ,
103
106
] }
104
107
>
105
108
< Slot />
You can’t perform that action at this time.
0 commit comments