-
Notifications
You must be signed in to change notification settings - Fork 199
input with type="radio" incorrectly flagged with react-a11y-role-has-required-aria-props #409
Comments
Looks like the issue is that we're looking for explicit aria-properties, even for elements that have implicit roles. Maybe we should only be looking for aria- properties on elements that have explicit roles? For elements with implicit roles, it's the browser's responsibility to provide the correct behavior. For something like I note that the code for this test has a special case for H1-H6 headings (which essentially have an implicit aria-level provided), but not for input. |
I'm having a similar issue right now, with <select id={id}>
<option>{option}</option>
</select>
|
And I can confirm that it also happens with <input
type="checkbox"
checked={enabled}
... />
I'm wondering if I'm missing something obvious. Any thoughts? :) |
@JoshuaKGoldberg, do you have any insight on this? |
Oh I'm no aria expert... but I'm sure @Harley-Adams would know what to do here! 😅 Edit: or @tommywilkinson, since Harley is battling spam bots and service fires this week... |
(@JoshuaKGoldberg, I don't think mentions send notifications on edits, could be wrong, but I believe @tommywilkinson was not notified... until now :D) |
Yeah, looking at the UIA tree for Edge confirms that the tags naturally get the toggle patterns we would expect. What would probably work best here is a mapping of tag type -> list of implicit properties. It looks like there's already one for tag -> implicit aria roles based off discussion above, so I would imagine adding ones for implicit properties should be pretty straightforward. |
https://www.w3.org/TR/wai-aria/roles#role_definitions. this link is now a 404 |
💀 It's time! 💀TSLint is deprecated and no longer accepting pull requests other than security fixes. See #876. ☠️ 👋 It was a pleasure open sourcing with you! |
I have react .tsx code similar to:
This gets flagged with the error react-a11y-role-has-required-aria-props:
This seems to be a false-positive in this case - we're not using
role=
here, just using a plain native input element, so no additional aria properties should be needed here.The text was updated successfully, but these errors were encountered: