-
Notifications You must be signed in to change notification settings -
Fork 4.1k
New issue
CustomSelectControl
: explore ariakit refactor
#55234
Conversation
brookewp
commented Oct 11, 2023
•
edited
Loading
edited
What?
Why?
How?
-
Review existing features of CustomSelectControl -
Create a rough component to start exploring API -
Determine if we can replace our current component -
Assess current tests for CustomSelectControl -
Add tests to the new component (cover any bugs, new features, etc) -
Refine types, add docs, and stories -
Request design input and implement styles -
Look at requests for new component -
Render children for more flexibility and customization
-
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Choose a reason for hiding this comment
|
||
|
||
|
||
|
Choose a reason for hiding this comment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Choose a reason for hiding this comment
{
selectedItem : "Curium" ,
type : "__item_click__" ,
highlightedIndex : - one ,
isOpen : false ,
inputValue : "" ,
}
const store = useSelectStore ( {
async setValue ( selectedItem ) {
if ( ! onChange ) return ;
// Executes the logic in a microtask after the popup is closed. This might not be necessary.
// This is simply to ensure the isOpen state matches that in Downshift.
await Promise . resolve ( ) ;
const state = store . getState ( ) ;
const changeObject = { selectedItem ,
type : "__item_click__" ,
highlightedIndex : state . renderedItems . findIndex ( ( item ) => item . value === selectedItem ) ,
isOpen : state . open ,
inputValue : "" ,
} ;
onChange ( changeObject ) ;
} ,
} ) ;
Choose a reason for hiding this comment