eslint-plugin-jsx-a11y icon indicating copy to clipboard operation
eslint-plugin-jsx-a11y copied to clipboard

[new rule] Dialog and Alert role elements have a label

Open jessebeach opened this issue 6 years ago • 1 comments

Elements with the role ARIA role dialog or alert require a label either provided by aria-label or aria-labelledby.

jessebeach avatar Dec 29 '18 02:12 jessebeach

I see this recommended for the dialog but it's not recommended nor implemented for alert.

Is there some general consensus for this plugin if the rules should follow the WAI-ARIA authoring practices or not?

eps1lon avatar Feb 08 '19 12:02 eps1lon

@ljharb Back to July, Jesse suggested to have a new rule for this one, something like window-has-title, but it seems to be already covered in control-has-associated-label, in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/tests/src/rules/control-has-associated-label-test.js I can see valid cases '<div role="dialog" /> and '<div role="alertdialog" />', what you think?

raylin666666 avatar Sep 29 '22 14:09 raylin666666

I agree, this use case seems covered. Happy to reopen if not.

ljharb avatar Sep 29 '22 16:09 ljharb

@ljharb Back to July, Jesse suggested to have a new rule for this one, something like window-has-title, but it seems to be already covered in control-has-associated-label, in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/tests/src/rules/control-has-associated-label-test.js I can see valid cases '<div role="dialog" /> and '<div role="alertdialog" />', what you think?

Great catch!

jessebeach avatar Sep 29 '22 17:09 jessebeach