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

jsx-a11y/media-has-caption Eslint Warning for Missing Captions in Media Elements #982

Open
soobing opened this issue Apr 23, 2024 · 1 comment

Comments

@soobing
Copy link

soobing commented Apr 23, 2024

Media elements such as <audio> and <video> are required to have a <track> tag for captions according to eslint jsx-a11y/media-has-caption.

I received an error stating that the <track> tag, which is a child of the <video> tag, is mandatory to have a src attribute. However, it appears that the error is resolved when there is a <track> tag child without a src attribute present.

Media elements such as <audio> and <video> must have a <track> for captions.eslint jsx-a11y/media-has-caption

Reproduce

<video></video>

Solved (actually this should not be solved)

<video><track kind="captions" /></video>
@soobing soobing changed the title Eslint Warning for Missing Captions in Media Elements jsx-a11y/media-has-caption Eslint Warning for Missing Captions in Media Elements Apr 23, 2024
@ljharb
Copy link
Member

ljharb commented Apr 23, 2024

There are limits to static analysis, and the rule currently does not check any props at all - it merely ensures you have a track element as a child.

Can you elaborate on I received an error stating that the <track> tag, which is a child of the <video> tag, is mandatory to have a src attribute.? Where did this error come from?

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

No branches or pull requests

2 participants