1
0
mirror of https://github.com/discourse/discourse.git synced 2025-03-08 20:49:50 +00:00

FIX: fix bugs with keyboard events

This commit is contained in:
Joffrey JAFFEUX 2017-11-21 16:59:03 +01:00 committed by GitHub
parent b5ed980235
commit 2087d011df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions
app/assets/javascripts/select-kit

@ -117,7 +117,7 @@ export default SelectKitComponent.extend({
},
didPressBackspace(event) {
this.expand();
this.expand(event);
this.keyDown(event);
this._destroyEvent(event);
},

@ -28,6 +28,7 @@ export default Ember.Mixin.create({
this.$filterInput()
.off("change.select-kit")
.off("keydown.select-kit")
.off("keypress.select-kit")
.off("focus.select-kit")
.off("focusin.select-kit");
},
@ -103,6 +104,9 @@ export default Ember.Mixin.create({
this.set("isFocused", true);
this._destroyEvent(event);
})
.on("keypress.select-kit", (event) => {
event.stopPropagation();
})
.on("keydown.select-kit", (event) => {
const keyCode = event.keyCode || event.which;