Skip to content

aria-expanded status not announced when ::before element has content #8341

@jmuheim

Description

@jmuheim

I'm working on a simple dropdown implementation. Using JavaScript, an aria-expanded attribute is toggled between false and true, and its specific content's visibility is toggled then.

I'm used to NVDA announcing a change of aria-expanded very reliably when the focus is on the specific link or button.

Demo: https://codepen.io/accessibility-developer-guide/pen/pKoJbK

But I noticed that when this link or button has some content with ::before { content: '...' }, the change is not announced anymore.

Demo: https://codepen.io/accessibility-developer-guide/pen/VdwvwW

I wanted to display a + or - sign in front of the dropdown toggler to indicate its status visually. But this doesn't seem to work with content: '...'.

Is this expected behaviour? Or a bug?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions