Skip to content

Aria-live attribute is not correctly used #391

@matthiask11

Description

@matthiask11

Environment

Nuxt 3.15 with vueform/nuxt 1.10.0 - theme vueform - npm

But it should be the same on every environment

Reproduction

https://stackblitz.com/edit/github-amp2jsug?file=src%2FApp.vue

Describe the bug

The aria-live attribute for the ElementError is not used in the correct way.

Image

In the picture you see the DOM after an error occured on an input element in the form.

As seen the aria-live attribute is on the ElementError itself. Thats means that the attribute is not present in the DOM when the ElementError is pushed into the wrapper element.

How should it be?
The aria-live attribute should already be present in the DOM when the error occurs, so that the Screenreader can already track this element for changes/updates.

See the correct way below: (I manipulated the DOM locally)

Image

Quote from the MDN docs:
"Assistive technologies will generally only announce dynamic changes in the content of a live region. [...] Start with an empty live region, then – in a separate step – change the content inside the region."

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions