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
Copy file name to clipboardExpand all lines: lib/assertions.js
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -68,17 +68,19 @@ exports.props = {
68
68
}
69
69
},
70
70
71
-
BUTTON_ROLE_NO_KEYUP: {
72
-
msg: 'You have `role="button"` but did not define an `onKeyUp` handler. Add it, and have the "Space" key do the same thing as an `onClick` handler.',
71
+
// onKeyUp is too late to cancel space's default behavior of scrolling the
72
+
// page.
73
+
BUTTON_ROLE_SPACE: {
74
+
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.',
73
75
test(tagName,props,children){
74
-
return!(props.role==='button'&&!props.onKeyUp);
76
+
return!(props.role==='button'&&!props.onKeyDown);
75
77
}
76
78
},
77
79
78
-
BUTTON_ROLE_NO_KEYDOWN: {
80
+
BUTTON_ROLE_ENTER: {
79
81
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.',
0 commit comments