Skip to content

hx-indicator default styles do not work for screen reader users #3354

@thibaudcolas

Description

@thibaudcolas

The htmx-indicator default styles rely on opacity only. Because of this, indicator elements are only visually hidden. It still appears in the accessibility tree for screen reader users. And for hover / focus if that indicator was interactive.

Here’s a recording of VoiceOver macOS in Safari demonstrating the issue on the Cascading Selects example (though note due to the demo site’s "instant" server responses, the indicator is effectively useless there).

hx-indicator.opacity.mp4

The best fix is probably to either add, or switch to the visibility property, which preserves layout like opacity but also removes elements from the accessibility tree.

Additionally, worth noting those <img> elements are missing an alt attribute. That attribute is never optional, and will make it so screen reader users aren’t told the image’s file name or URL, which is pretty meaningless to them (related: #1431).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions