FIX: allows more chars than a-z in select-kit

This commit is contained in:
Joffrey JAFFEUX 2018-06-25 12:52:20 +02:00 committed by GitHub
parent d08b596e47
commit 666386d4b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

@ -66,10 +66,10 @@ export default Ember.Mixin.create({
this._destroyEvent(event);
})
.on("keydown.select-kit", event => {
const keyCode = event.keyCode || event.which;
if (document.activeElement !== this.$header()[0]) return event;
const keyCode = event.keyCode || event.which;
if (keyCode === this.keys.TAB && event.shiftKey) {
this.unfocus(event);
}
@ -104,13 +104,11 @@ export default Ember.Mixin.create({
this.set("renderedFilterOnce", true);
}
if (keyCode >= 65 && keyCode <= 122) {
Ember.run.schedule("afterRender", () => {
this.$filterInput()
.focus()
.val(this.$filterInput().val() + String.fromCharCode(keyCode));
});
}
return false;
});