File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
packages/kit-headless/src/components/select Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
useOnWindow ,
11
11
useStore ,
12
12
useVisibleTask$ ,
13
+ QwikIntrinsicElements ,
13
14
} from '@builder.io/qwik' ;
14
15
import { computePosition , flip } from '@floating-ui/dom' ;
15
16
@@ -71,7 +72,11 @@ export const SelectRoot = component$(
71
72
const expanded = track ( ( ) => isExpanded . value ) ;
72
73
73
74
if ( expanded && trigger && listBox ) {
74
- updatePosition ( trigger , listBox ) ;
75
+ listBox . style . visibility = 'hidden' ;
76
+
77
+ updatePosition ( trigger , listBox ) . then ( ( ) => {
78
+ listBox . style . visibility = 'visible' ;
79
+ } ) ;
75
80
}
76
81
77
82
if ( expanded === false ) {
@@ -113,9 +118,9 @@ export const SelectRoot = component$(
113
118
}
114
119
) ;
115
120
116
- export interface TriggerProps extends StyleProps {
121
+ export type TriggerProps = {
117
122
disabled ?: boolean ;
118
- }
123
+ } & QwikIntrinsicElements [ 'button' ] ;
119
124
120
125
export const SelectTrigger = component$ (
121
126
( { disabled, ...props } : TriggerProps ) => {
@@ -128,7 +133,8 @@ export const SelectTrigger = component$(
128
133
ref = { ref }
129
134
aria-expanded = { contextService . isExpanded . value }
130
135
disabled = { disabled }
131
- onClick$ = { ( ) => {
136
+ onClick$ = { ( e ) => {
137
+ e . stopPropagation ( ) ;
132
138
contextService . isExpanded . value = ! contextService . isExpanded . value ;
133
139
} }
134
140
onKeyDown$ = { ( e ) => {
You can’t perform that action at this time.
0 commit comments