Skip to content

Commit 79c9ece

Browse files
fix(popover): input interactions work with combobox
1 parent 43abfcb commit 79c9ece

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/kit-headless/src/components/combobox/combobox-input.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
getNextEnabledOptionIndex,
1616
getPrevEnabledOptionIndex,
1717
} from './utils';
18+
import { usePopover } from '../popover';
1819

1920
export type ComboboxInputProps = {
2021
disableOnBlur?: boolean;
@@ -26,6 +27,8 @@ export const ComboboxInput = component$(
2627
...props
2728
}: ComboboxInputProps) => {
2829
const context = useContext(ComboboxContextId as ContextId<ComboboxContext<O>>);
30+
const triggerId = `${context.localId}-trigger`;
31+
const { initPopover$ } = usePopover(triggerId);
2932

3033
const inputId = props.id || `${context.localId}-input`;
3134
const listboxId = `${context.localId}-listbox`;
@@ -149,7 +152,7 @@ export const ComboboxInput = component$(
149152
}
150153
aria-controls={listboxId}
151154
value={context.inputValueSig.value}
152-
onInput$={[onInputBehavior$, props.onInput$]}
155+
onInput$={[onInputBehavior$, props.onInput$, initPopover$]}
153156
onBlur$={[
154157
$(() => {
155158
disableOnBlur ? null : (context.isListboxOpenSig.value = false);

0 commit comments

Comments
 (0)