CustomSelectControl: Button description doesn't update correctly when uncontrolled #67759
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Components
/packages/components
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
When in uncontrolled mode, the trigger button of the
CustomSelectControl
doesn't get its ARIA description updated properly after a selection change.Steps to reproduce
In the Storybook for CustomSelectControl, add a temporary story to test uncontrolled mode.
In DevTools, see the the accessibility panel for the main combobox button. The button description will not update after changing the selected options.
Proposed solution
In uncontrolled mode, the outer component (
CustomSelectControl
) doesn't get re-rendered on selection change, so thecurrentValue
is not updated accordingly:gutenberg/packages/components/src/custom-select-control/index.tsx
Line 208 in f430cd7
We might want to subscribe to
_CustomSelect
store updates viaonChange
so this part can be re-rendered on store state changes.The text was updated successfully, but these errors were encountered: