Combobox: Port to react hooks
Combobox: Port existing combobox to react hooks
Component details
Combobox which can allow freeform text entry and has autocomplete
Description
The existing combobox would benefit greatly from being implemented with react hooks in fabric 7 as a "createcomponent" this would make it easier to customize and modify easily via slots.
Component ownership
Me, @joschect
Component composition
It will consist of a container, an input/button/label which displays the current selected item, and a callout/menu which will be opened on focus to allow the items to be picked.
Imports/Dependencies
Autofill, button, callout
Exports/Component breakdown
- Root component that will be used by both combobox and dropdown
- Selection item to standardize combobox and dropdown items
- Combobox itself
- (Potentially) Optional helper components and state management.
Intended package/s
Experiments
Public methods
| Name | Type | Description |
|---|---|---|
| focus | () => void | Sets focus on the control |
Slots
| Name | Type | Description |
|---|---|---|
| root | div | The outermost element |
| input | button/input | The primary element used to display the current value |
| menu | callout | The floating menu which contains the selection items |
| selectionItem | selectionItem | The item that will appear in the menu |
Tokens
TBD
Props
TBD
Component Progress
Current state
Todos
- [ ] Refactor existing combobox code. This has 2 benefits, 1 is that it will help me understand the existing behavior and 2 is it will enable that code to be moved more easily. Also leverages existing tests to ensure behavior is maintained.
- [ ] Add more tests to existing combobox to ensure that behavior is preserved.
- [ ] Create new combobox component in branch 7
- [ ] Create new selectionitem component in branch 7
- [ ] Ensure that new combobox is built from easily composable pieces so that dropdown can be easily implemented with base components. Also consider making pickers possible.
Steps
- [ ] Themable
- [ ] Unit tests
- [ ] Visual tests
- [ ] Documentation and examples
- [ ] Keyboard Accessible
- [ ] High Constrast Support
- [ ] RTL Support
- [ ] Ready for Publishing
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.