Skip to content

Add aria-description to HTML Attributes #14390

Open
@lucas-subli

Description

@lucas-subli

Describe the bug

Using aria-description triggers the unknown property warning.

Aria description is global and should apply to all HTML tags: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes#global_aria_attributes

Aria-description serves the same purpose as aria-described. However, the aria-description property should only be used when providing a visible description is not the desired user experience.

This is a regression since it should have been fixed here: #7301

Reproduction

Just use aria-description to an HTML element and observe the compiler warning.

<div aria-description="hello">
	World
</div>

image

Logs

Object literal may only specify known properties, and '"aria-description"' does not exist in type 'HTMLProps<"div", HTMLAttributes<any>>'.js(2353)

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
    Memory: 24.94 GB / 31.05 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 9.8.0 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 131.0.6778.85
  npmPackages:
    svelte: 5.0.0 => 5.0.0

Severity

annoyance

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