Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aria-description to HTML Attributes #14390

Open
lucas-subli opened this issue Nov 21, 2024 · 2 comments
Open

Add aria-description to HTML Attributes #14390

lucas-subli opened this issue Nov 21, 2024 · 2 comments

Comments

@lucas-subli
Copy link

lucas-subli commented Nov 21, 2024

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

@lucas-subli lucas-subli changed the title Add aria-description to a11y linting Add aria-description to HTML Attributes Nov 21, 2024
@harrisi
Copy link

harrisi commented Nov 21, 2024

aria-description is not accepted yet, so it seems like it was prematurely added and rightfully removed. Using aria-describedby should be used until the standard is finalized, at which point svelte should accommodate any changes.

@dummdidumm
Copy link
Member

Correct - we'll add this to the type definitions once this is standardized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants