Skip to content
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: Button description doesn't update correctly when uncontrolled #67759

Closed
mirka opened this issue Dec 9, 2024 · 0 comments · Fixed by #67815
Closed

CustomSelectControl: Button description doesn't update correctly when uncontrolled #67759

mirka opened this issue Dec 9, 2024 · 0 comments · Fixed by #67815
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

Comments

@mirka
Copy link
Member

mirka commented Dec 9, 2024

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.

export const Uncontrolled = {
	args: {
		...Default.args,
	},
};

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 the currentValue is not updated accordingly:

{ getDescribedBy( currentValue, describedBy ) }

We might want to subscribe to _CustomSelect store updates via onChange so this part can be re-rendered on store state changes.

@mirka mirka added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Type] Bug An existing feature does not function as intended labels Dec 9, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant