accessibility-insights-web
                                
                                
                                
                                    accessibility-insights-web copied to clipboard
                            
                            
                            
                        button-name rule not considering label linked to button
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:
- Go to '...'
 - Click on '...'
 - Scroll down to '...'
 - 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
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.
The team requires additional author feedback; please review their replies and update this issue accordingly. Thank you for contributing to Accessibility Insights!
I see, thanks for linking the w3 document. It looks this issue is not a bug then.
The team requires additional author feedback; please review their replies and update this issue accordingly. Thank you for contributing to Accessibility Insights!
Thanks for confirming @cchengt! Is there anything else we can help with or can we go ahead and close this issue?
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!