Skip to content
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

AO3-5315 Switch away from the deprecated KeyboardEvent.keyCode property #3559

Merged
merged 4 commits into from Apr 4, 2019

Conversation

Projects
None yet
3 participants
@palindromordnilap
Copy link
Contributor

commented Apr 3, 2019

Issue

https://otwarchive.atlassian.net/browse/AO3-5315

Purpose

Fixes the use of the deprecated KeyboardEvent.keyCode property in the auto-complete code, which causes some issues with keyboards that don't use the US QWERTY layout. This PR replaces that property, when available in the browser, with the newer KeyboardEvent.key which outputs the actual key pressed instead of its place on the keyboard, and fixes a compatibility issue with IE and Edge arising from this.

Note that this does not fix AO3-5271, at least on Chrome for Android with a SwiftKey keyboard. This is probably a browser-side problem, as the keyboard event system seems to be pretty much broken by default.

Testing Instructions

See ticket. Note that I couldn't replicate the issue using Firefox 66 on Linux with a French AZERTY keyboard, which seems to be caused by the browser itself sending the correct key codes for compatibility purposes.

Credit

What name do you want us to use to credit your work in the Archive of Our Own's Release Notes?

Alix

What pronouns do you prefer (she/her, he/him, zie/hir etc)?

She/her

Show resolved Hide resolved public/javascripts/jquery.tokeninput.js Outdated
Show resolved Hide resolved public/javascripts/jquery.tokeninput.js Outdated
Show resolved Hide resolved public/javascripts/jquery.tokeninput.js Outdated
@sarken

sarken approved these changes Apr 4, 2019

Copy link
Member

left a comment

Thank you so much for this!

@sarken sarken merged commit c8fe139 into otwcode:master Apr 4, 2019

4 checks passed

Hound No violations found. Woof!
Scrutinizer No new issues
Details
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@palindromordnilap palindromordnilap deleted the palindromordnilap:ao3-5315 branch Apr 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.