Skip to content

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

@lgersman

Description

@lgersman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done 🎉

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions