Skip to content

Commit eecf9a5

Browse files
refactor(autocomplete root): naming convention changes / refactor
1 parent 8240870 commit eecf9a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/kit-headless/src/components/autocomplete/autocomplete-root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,19 @@ export const AutocompleteRoot = component$(
130130
const isExpanded = useSignal(false);
131131
const triggerRef = useSignal<HTMLElement>();
132132
const listBoxRef = useSignal<HTMLElement>();
133+
const rootRef = useSignal<HTMLElement>();
133134
const labelRef = useSignal<HTMLElement>();
134135
const inputValue = useSignal(defaultValue ? defaultValue : '');
135136
const listBoxId = useId();
136137
const inputId = useId();
137138
const buttonId = useId();
138139
const activeOptionId = useSignal(null);
139140
const focusInput$ = $((inputId: string) => {
140-
triggerRef.value
141+
rootRef.value
141142
?.querySelector<HTMLElement>(
142143
`[data-autocomplete-input-id="${inputId}"]`
143144
)
144145
?.focus();
145-
146-
console.log(triggerRef.value);
147146
});
148147

149148
const contextService: AutocompleteContext = {
@@ -228,6 +227,7 @@ export const AutocompleteRoot = component$(
228227
props.onKeyDown$,
229228
]}
230229
{...props}
230+
ref={rootRef}
231231
>
232232
<Slot />
233233
</div>

0 commit comments

Comments
 (0)