Skip to content

Commit 42f2bf2

Browse files
mark refs as experimental (#874)
1 parent 8af8c68 commit 42f2bf2

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

.changeset/stale-mails-do.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ The `value` prop has been added to the `Combobox.Root` component to select the i
202202

203203
You can also now listen to when the input value changes by using the `onInput$` prop on the `<Combobox.Root />` component.
204204

205-
#### Passing refs to the combobox
205+
#### Passing refs to the combobox (experimental)
206206

207-
The combobox is the first component to support passing refs! You can now pass a ref of your own to any component inside the combobox.
207+
The combobox is the first component to support passing refs! You can now pass a ref of your own to any component inside the combobox. This is an experimental feature, and we are still working on it, use at your own risk.
208208

209209
```tsx
210210
const inputRef = useSignal<HTMLInputElement>();

apps/website/src/routes/docs/headless/combobox/index.mdx

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Qwik UI | Combobox
33
---
44

55
import { statusByComponent } from '~/_state/component-statuses';
6-
import { FeatureList } from '~/components/feature-list/feature-list';
76

87
<StatusBanner status={statusByComponent.headless.Combobox} />
98

@@ -297,9 +296,9 @@ When a value is not selected, the placeholder is displayed.
297296

298297
## Advanced
299298

300-
### Using Refs
299+
### Using Refs (experimental)
301300

302-
You can pass a ref to each Combobox component to access the underlying DOM element.
301+
You can pass a ref to each Combobox component to access the underlying DOM element. This is an experimental feature, and we are still working on it, use at your own risk.
303302

304303
<Showcase name="refs" />
305304

apps/website/src/routes/docs/headless/select/examples/hero.tsx

+2-17
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
1-
import { component$, useSignal, useStyles$, useVisibleTask$ } from '@builder.io/qwik';
1+
import { component$, useStyles$ } from '@builder.io/qwik';
22
import { Select } from '@qwik-ui/headless';
33

44
export default component$(() => {
55
useStyles$(styles);
66
const users = ['Tim', 'Ryan', 'Jim', 'Jessie', 'Abby'];
77

8-
const rootRef = useSignal<HTMLDivElement>();
9-
const labelRef = useSignal<HTMLDivElement>();
10-
const triggerRef = useSignal<HTMLButtonElement>();
11-
const displayValueRef = useSignal<HTMLDivElement>();
12-
const popoverRef = useSignal<HTMLDivElement>();
13-
14-
useVisibleTask$(() => {
15-
console.log('rootRef');
16-
console.log(rootRef.value);
17-
console.log(labelRef.value);
18-
console.log(triggerRef.value);
19-
console.log(displayValueRef.value);
20-
console.log(popoverRef.value);
21-
});
22-
238
return (
24-
<Select.Root class="select" ref={rootRef}>
9+
<Select.Root class="select">
2510
<Select.Label>Logged in users</Select.Label>
2611
<Select.Trigger class="select-trigger">
2712
<Select.DisplayValue placeholder="Select an option" />

0 commit comments

Comments
 (0)