Skip to content

Screen reader issue with floating labels #41362

@HalHaynes

Description

@HalHaynes

Prerequisites

Describe the issue

The floating labels are lovely but there's an accessibility issue for screen readers (at least for NVDA on Chrome in Windows). Because the label is required to come after the input field, the screen reader reads it after it reads the field's contents. The label should be read first. I see the explanation in the documentation that "Also note that the <input> must come first so we can utilize a sibling selector (e.g., ~)" but unfortunately it creates this problem. (By the way, "e.g." = "exempli gratia" = "for [the sake of] example" is incorrect, this should read "i.e." = "id est" = "that is".)

Reduced test cases

This can readily be verified by running a screen reader over the examples at the documentation, https://getbootstrap.com/docs/5.0/forms/floating-labels/.

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

v5.3.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions