-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomSelectControl
: Add adapter for legacy to new version
#57000
Conversation
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.
packages/components/src/custom-select-control-v2/use-deprecated-props.tsx
Show resolved
Hide resolved
expect( currentSelectedItem ).toHaveTextContent( 'amber' ); | ||
} ); | ||
|
||
it( 'Can change selection with a focused input and closed dropdown if typed characters match an option', async () => { |
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.
There has been some flakiness with this test and I'm wondering if there is some leaky tests. Will be checking this as this moves along
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.
Still need to mark the props as to be deprecated, if we decide we want to go with this option
Flaky tests detected in ee89e01. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7494430548
|
9a6874c
to
79116aa
Compare
93f8d99
to
d9c13ab
Compare
// temp ignore | ||
//@ts-ignore | ||
defaultValue: props?.value?.name ?? undefined, |
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.
Have a type error here related to the Option
type — reminder to look into this so it can be removed
942f021
to
48333c9
Compare
48333c9
to
ee89e01
Compare
Closing in favour of #57902 |
What?
Part of #55023
Note
WIP: This is a WIP, and some pieces may be separated into other PRs if possible. For now, this is where all the experiments are happening.
Why?
To transition away from using CustomSelectControl to the new version for more flexibility.
How?
Inspired by ColorPicker, this looks at the props to determine if it's the new version or the legacy version of CustomSelectControl. If it's the legacy, then the props are translated into the new props, so the new ariakit version can be utilized instead.
No changes were made to CustomSelect or to CustomSelectItem, aside from moving them to their own files.
This also adds the same tests from CustomSelectControl. The only changes made were to the role which is now combobox instead of button and the tests for the custom event handlers have been removed.
Follow-up PR
Tests
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast