Skip to content

Commit 779f478

Browse files
feat(select): beta, including changeset
1 parent 4fb89cc commit 779f478

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.changeset/tidy-coats-admire.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@qwik-ui/headless': patch
3+
---
4+
5+
## Select component hits beta!
6+
7+
## Features
8+
9+
- Accessible as a button that shows a list, following web a11y standards.
10+
- Support for single selection.
11+
- Controlled or uncontrolled.
12+
- Disabled option support.
13+
- Stop focus management via the Tab key.
14+
- Grouped options support.
15+
- Looping support.
16+
- Support for custom scroll behavior.
17+
- Listbox UI is placed above everything else. (SelectPopover)
18+
- Custom Positioning (SelectPopover)
19+
- Option selection and focus management by typing (typeahead).
20+
- Keyboard support for option navigation via arrow keys and focus management.
21+
- Automatic focus management for first and last options.
22+
- Supports a custom placeholder.
23+
24+
## Roadmap
25+
26+
- Opt-in native form support via a visually hidden select.
27+
- RTL support.
28+
- Multiple Selection and its respective keyboard interactions.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*!
2+
* Portions of this file are based on code from react-spectrum.
3+
* Apache License Version 2.0, Copyright 2020 Adobe.
4+
*
5+
* Credits to the React Spectrum team:
6+
* https://github.com/adobe/react-spectrum/blob/5c1920e50d4b2b80c826ca91aff55c97350bf9f9/packages/@react-aria/select/src/HiddenSelect.tsx
7+
*/
8+
9+
import { PropsOf, component$ } from '@builder.io/qwik';
10+
11+
export interface AriaHiddenSelectProps {
12+
/**
13+
* Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
14+
*/
15+
autoComplete?: string;
16+
17+
/** The text label for the select. */
18+
label?: PropsOf<'label'>;
19+
20+
/** HTML form input name. */
21+
name?: string;
22+
23+
/** Sets the disabled state of the select and input. */
24+
disabled?: boolean;
25+
}
26+
27+
// export function useHiddenSelect(props: AriaHiddenSelectProps) {
28+
// const { autoComplete, name, disabled } = props;
29+
// }
30+
31+
export const HiddenSelect = component$((props: AriaHiddenSelectProps) => {
32+
const { name, disabled } = props;
33+
34+
return (
35+
<>
36+
<div>
37+
<input />
38+
</div>
39+
{name && <input type="hidden" name={name} disabled={disabled} />}
40+
</>
41+
);
42+
});

0 commit comments

Comments
 (0)