@wordpress/components : Add "title" attribute support to options of rendered select element #43475
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
What problem does this address?
The SelectControl currently only supports
id
,label
,value
anddisabled
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 controlsoptions
property which gets mapped to the rendered<option>
HTML elementstitle
attribute.Moreover, if an item was selected the selected item
description
(akatitle
) should be set as the rendered<select>
HTML elementtitle
attribute so that hovering over the control would show up the native tooltip with the description of the currently selected item.The text was updated successfully, but these errors were encountered: