Skip to content

LinkControlSearchInput: Explore way to provide better label and placeholder #69652

@t-hamano

Description

@t-hamano

See #69620 (comment)

What problem does this address?

In #65458, some changes were made to match the visible label (placeholder attribute) with the actual label (aria-label attribute).

This approach will work if there is no visual label in the LinkControlSearchInput component, but it won't work as expected if it has a visual label ( hideLabelFromVision is false ).

That is, the visual label and the placeholder text will overlap (See #66313):

What is your proposed solution?

To temporarily fix this issue in the 6.8 release, #69620 was submitted. However, this approach is not ideal, so we need to investigate a more ideal approach. I think we need to consider the following points:

  • If we want to hide the label visually and use the placeholder as the label instead, the aria-label should match the placeholder.
  • Consumers may want to disable the placeholder but provide a label for the a11y.
  • If a label for the a11y is visually displayed, I think the label should not have to match the placeholder; the placeholder should serve as a description, not a label.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Package] Block editor/packages/block-editor[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions