Skip to content

Feature Request: Ensure Space-Separated Values for ARIA Attributes #15282

@daviareias

Description

@daviareias

Describe the problem

Currently, passing an array to ARIA attributes in Svelte (e.g., aria-describedby, aria-labelledby, etc.) results in a comma-separated string ("id1,id2"). However, per ARIA spec, multiple IDs should be space-separated ("id1 id2").

The following code:

<input aria-describedby={["id1", "id2"]} />

Should render as:

<input aria-describedby="id1 id2">

But it renders as:

<input aria-describedby="id1,id2">

Affected Attributes

  • aria-describedby
  • aria-labelledby
  • aria-owns
  • Any ARIA attribute accepting multiple IDs

Describe the proposed solution

When an array is passed to ARIA attributes, join values with a space instead of a comma.

Would love to hear thoughts on this! Thanks! 🙌

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions