-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make sure data-disabled is available on virtualized options #3128
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@thecrypticace if I'm not mistaken we run all tests for the Combobox against a virtual and non-virtual version. So if you add a test where you explicitly test that data-disabled is present then that should cover this. Undoing your change should then result in a failing test. |
We run all the "interaction" tests but not rendering tests. But this is simple enough to add a test for — will do! |
Test added |
This way we only have to calculate it once and we can re-use that information throughout the component. If the `value` changes of the option, then the component has to re-render anyway which will re-compute the `disabled` state.
When using a combobox disabled options get a
data-disabled
attribute that can be used for styling. However, when the combobox was virtualized we were not. This happened because we were only looking at the disabled prop on the option itself but a virtual combobox uses a disabled function in thevirtual
options to determine whether or not an option is enabled.This fixes that 👍
@RobinMalfait you have an idea on how this should be tested?