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
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',
106
43
test(tagName,props,children){
107
-
return!needsTabIndex(tagName,props);
44
+
return!(
45
+
!isInteractive(tagName,props)&&
46
+
!props.tabIndex
47
+
);
108
48
}
109
49
},
110
50
111
51
NO_LABEL: {
112
52
msg: 'You have a click handler on an element with no screen-readable text. Add `aria-label` or `aria-labelled-by` attribute, or put some text in the element.',
113
53
test(tagName,props,children){
114
-
return!needsLabel(props,children);
54
+
return(
55
+
props['aria-label']||
56
+
props['aria-labelled-by']||
57
+
hasChildTextNode(props,children)
58
+
);
115
59
}
116
60
},
117
61
@@ -135,9 +79,9 @@ exports.props = {
135
79
exports.tags={
136
80
a: {
137
81
HASH_HREF_NEEDS_BUTTON: {
138
-
msg: 'You have a click handler on an anchor with an `href` DOM property and no `role` DOM property. Add `role="button"` to your markup, or you should probably just use a `<button/>`.',
82
+
msg: 'You have an anchor with `href="#"` and no `role` DOM property. Add `role="button"` or better yet, use a `<button/>`.',
139
83
test(tagName,props,children){
140
-
return!needsButtonRole(props);
84
+
return!(!props.role&&props.href==='#');
141
85
}
142
86
}
143
87
},
@@ -154,7 +98,7 @@ exports.tags = {
154
98
// TODO: have some way to set localization strings to match against
155
99
msg: 'Screen-readers already announce `img` tags as an image, you don\'t need to use the word "image" in the description',
0 commit comments