You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[fixed] bug where placeholder links required a tabindex and an ARIA role (closes#62)
[fixed] bug where elements with role=none required a label (closes#63)
[fixed] bug where elements with aria-hidden required a label (closes#64)
[added] test to ensure interactive elements hidden using aria-hidden are removed from the tab flow
msg: 'You have a click handler on a non-interactive element but no `role` DOM property. It will be unclear what this element is supposed to do to a screen-reader user. http://www.w3.org/TR/wai-aria/roles#role_definitions',
msg: 'You have a click handler on a non-interactive element but no `tabIndex` DOM property. The element will not be navigable or interactive by keyboard users. http://www.w3.org/TR/wai-aria-practices/#focus_tabindex',
119
135
test(tagName,props,children){
136
+
if(isHiddenFromAT(props))
137
+
returntrue;
138
+
120
139
return!(
121
140
!isInteractive(tagName,props)&&
122
141
props.tabIndex==null// tabIndex={0} is valid
@@ -127,17 +146,35 @@ exports.props = {
127
146
BUTTON_ROLE_SPACE: {
128
147
msg: 'You have `role="button"` but did not define an `onKeyDown` handler. Add it, and have the "Space" key do the same thing as an `onClick` handler.',
129
148
test(tagName,props,children){
149
+
if(isHiddenFromAT(props))
150
+
returntrue;
151
+
130
152
return!(props.role==='button'&&!props.onKeyDown);
131
153
}
132
154
},
133
155
134
156
BUTTON_ROLE_ENTER: {
135
157
msg: 'You have `role="button"` but did not define an `onKeyDown` handler. Add it, and have the "Enter" key do the same thing as an `onClick` handler.',
136
158
test(tagName,props,children){
159
+
if(isHiddenFromAT(props))
160
+
returntrue;
161
+
137
162
return!(props.role==='button'&&!props.onKeyDown);
138
163
}
139
164
}
165
+
},
140
166
167
+
'aria-hidden': {
168
+
'TABINDEX_REQUIRED_WHEN_ARIA_HIDDEN': {
169
+
msg: 'You have `aria-hidden="true"` applied to an interactive element but have not removed it from the tab flow. This could result in a hidden tab stop for users of screen readers.',
0 commit comments