-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[select] un/controlled activeItem & query! (#2747)
* move resetOnSelect to IListItemsProps so all components share it * ⭐ allow activeItem and query to be un/controlled move required props from IQueryListProps to optional in IListItemsProps! add handleQueryChange to renderer props. move activeItem/query state into IQueryListState * QueryList initialize state and update renderer usage * refactor QueryList to control activeItem and query and always pick an enabled first item * refactor four friends to push state into QueryList * little fixes * common suite of tests for select components * update docs: no value/onChange in inputProps * tzp tests * only invoke onQueryChange if it changed * revert Suggest (followup PR with more extensive changes) * [Suggest] refactor to support new QueryList state (#2748) * refactor Suggest to use QueryList's activeItem and query also remove isTyping state, which fixes double render. when open, selectedItem appears in placeholder instead of input value. this is a nicer experience and works great with resetOnSelect. * add resetOnSelect switch to Suggest example * revert disabled tests * fix esc/tab tests these keys used to clear the selection, now they just cancel a selection in progress and keep the previous selection state. * default placeholder * remove omnibar query prop (semantic conflict) * activeItem: T | null - explicit null for "no active item" - undefined optional prop puts it in uncontrolled mode * maybeRenderClearButton
- Loading branch information
Showing
16 changed files
with
227 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
d202674
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[select] un/controlled activeItem & query! (#2747)
Preview: documentation | landing | table