accessibility-insights-web icon indicating copy to clipboard operation
accessibility-insights-web copied to clipboard

button-name rule not considering label linked to button

Open cchengt opened this issue 3 years ago • 5 comments

Describe the bug

Hello, I have linked to text-less via the label "for" attribute; I assumed this would be enough to pass the button-name check but it didn't. When tested with Narrator, the screen reader reads out the button's associated label.

To Reproduce Fast check this HTML:

test
  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

CodePen repro example

https://codepen.io/cchengts/pen/VwXGgRP

Expected behavior

No button-name violation

Context (please complete the following information)

  • OS Name & Version: Windows 11
  • AI-Web Version & Environment: 2.32.0
  • Browser Version: Edge Version 104.0.1293.47 (Official build) (64-bit)
  • Target Page: N/A

Are you willing to submit a PR?

Maybe, I'm not sure how involved it would be

Did you search for similar existing issues?

Yes, but none found

cchengt avatar Aug 12 '22 15:08 cchengt

Hi @cchengt! I was able to reproduce the button-name error you are referencing. Looks like per Using label elements to associate text labels with form controls, label is not to be used for a button.

Passing examples and alternatives can be found here: button-name.

shanisebarona avatar Aug 12 '22 21:08 shanisebarona

The team requires additional author feedback; please review their replies and update this issue accordingly. Thank you for contributing to Accessibility Insights!

ghost avatar Aug 15 '22 14:08 ghost

I see, thanks for linking the w3 document. It looks this issue is not a bug then.

cchengt avatar Aug 15 '22 14:08 cchengt

The team requires additional author feedback; please review their replies and update this issue accordingly. Thank you for contributing to Accessibility Insights!

ghost avatar Aug 15 '22 15:08 ghost

Thanks for confirming @cchengt! Is there anything else we can help with or can we go ahead and close this issue?

sfoslund avatar Aug 15 '22 15:08 sfoslund

This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for contributing to Accessibility Insights!

ghost avatar Aug 19 '22 18:08 ghost