-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced deprecated keyCode functionality and docs with KeyboardEvent.code & KeyboardEvent.key also updates the keyIsDown function to accept alphanumerics as parameters #7472
Changes from 2 commits
dd458c0
bcbed0f
c42bb7e
5709aac
0ce4e89
9cfef5a
e0c4a31
ad5ae5b
805a5c9
6d0c0ea
e01add6
e3fc37c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,6 +189,11 @@ suite('Keyboard Events', function() { | |
assert.isTrue(isCode('Control')); | ||
assert.isTrue(isCode('ab')); | ||
}); | ||
|
||
test('returns false for strings for letright keys', function() { | ||
assert.isFalse(isCode('AltLeft')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we want Hitting the alt key, it outputs: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's right. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed this, returning false for keys and true for codes |
||
assert.isFalse(isCode('ShiftRight')); | ||
}); | ||
|
||
test('handles edge cases correctly', function() { | ||
assert.isFalse(isCode('')); // empty string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that we're defining
isCode
twice -- I think we can remove this one, and just use theexport
ed one above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, sure.