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

@wordpress/components : Add "title" attribute support to options of rendered select element #43475

Closed
lgersman opened this issue Aug 22, 2022 · 3 comments
Labels
[Feature] Component System WordPress component system [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components

Comments

@lgersman
Copy link

What problem does this address?

The SelectControl currently only supports id, label, value and disabled properties for the rendered <option> HTML elements.

There is no way to specifiy the title attribute for the rendered <option> elements.

For improving UX experience it would be nice to have the <option> title attribute addressable.

In that case users could see a descriptive information about the hovered item.

What is your proposed solution?

Developers should supply an additional description attribute within the controls options property which gets mapped to the rendered <option> HTML elements title attribute.

Moreover, if an item was selected the selected item description (aka title) should be set as the rendered <select> HTML element title attribute so that hovering over the control would show up the native tooltip with the description of the currently selected item.

@glendaviesnz glendaviesnz added the [Feature] Component System WordPress component system label Aug 30, 2022
@ciampo ciampo added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components labels Sep 2, 2022
@afercia
Copy link
Contributor

afercia commented Nov 10, 2022

Worth reminding that WordPress has been progressively removing the title attribute from most part of the codebase. Title attributes are accessible to only a fraction of users. Keyboard users can't see them. Screen reader users may miss them, depending also on their screen reader verbosity settings.

For more details, please see https://core.trac.wordpress.org/ticket/24766
For all the work done in core to remove most of the title attributes in the admin, see https://core.trac.wordpress.org/query?keywords=~title-attribute

@ciampo ciampo moved this to Todo in Andrew's onboarding May 3, 2023
@ciampo ciampo moved this from Todo to Up next in Andrew's onboarding Aug 30, 2023
@andrewhayward
Copy link
Contributor

Just to add to @afercia's comments here, we really shouldn't be encouraging developers to rely on the use of title attributes to communicate information to the user, which I'd argue calling it 'description' would probably do here. A large subset of modern web users simply don't have the option of accessing 'descriptive information about the hovered item'.

@andrewhayward andrewhayward moved this from Up next to Paused in Andrew's onboarding Aug 30, 2023
@ciampo ciampo closed this as completed Aug 30, 2023
@ciampo
Copy link
Contributor

ciampo commented Aug 30, 2023

Closing as per the explanations above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Component System WordPress component system [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components
Projects
Status: Done 🎉
Development

No branches or pull requests

5 participants