-
-
Notifications
You must be signed in to change notification settings - Fork 188
Open
Labels
Description
Feature request
Summary
I wanted to make Select.Popup
a virtualized list. Works fine with mouse/pointer navigation, but keyboard navigation wouldn't focus on items past the virtualization window. This is a tricky issue to workaround, because Select
builds its internal options array from Select.Item
children, and only a handful are rendered at a time.
My suggestion would be to have an optional prop to hint Select
of all of the options (or the total option count), and expose a way to get the current focused index, which can be used to scroll the virtualized window to that item.
Examples in other libraries
react-select
has the options
props, but their API philosophy is different to that of headless libraries:
<Select
className="basic-single"
classNamePrefix="select"
defaultValue={colourOptions[0]}
isDisabled={isDisabled}
isLoading={isLoading}
isClearable={isClearable}
isRtl={isRtl}
isSearchable={isSearchable}
name="color"
options={colourOptions}
/>
Motivation
This is useful for rendering long lists or do infinite scrolling
dartess
Metadata
Metadata
Assignees
Labels
Projects
Status
No status