mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Use key over the deprecated keyCode (#13795)
Makes the code a bit more readable. Inspired by https://github.com/emberjs/ember.js/pull/19185
This commit is contained in:
@@ -24,7 +24,7 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
keyPress(e) {
|
||||
if (e.keyCode === 13) {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.send("addUser");
|
||||
|
||||
@@ -73,8 +73,8 @@ export default Component.extend({
|
||||
this.autoFocus();
|
||||
},
|
||||
|
||||
keyPress(key) {
|
||||
if (key.keyCode === 13) {
|
||||
keyPress(event) {
|
||||
if (event.key === "Enter") {
|
||||
if (this.showDoneButton) {
|
||||
this.send("quit");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user