FIX: override backspaceFromFilter only if defined
This commit is contained in:
parent
20e44b3c14
commit
20123271d2
|
@ -83,6 +83,10 @@ export default ComboBox.extend({
|
|||
}
|
||||
},
|
||||
|
||||
backspaceFromFilter(event) {
|
||||
this.didPressBackspace(event);
|
||||
},
|
||||
|
||||
didPressBackspace() {
|
||||
if (!this.get("isExpanded")) {
|
||||
this.expand();
|
||||
|
|
|
@ -108,7 +108,9 @@ export default Ember.Mixin.create({
|
|||
.on("keydown.select-kit", (event) => {
|
||||
const keyCode = event.keyCode || event.which;
|
||||
|
||||
if (keyCode === this.keys.BACKSPACE) this.backspaceFromFilter(event);
|
||||
if (keyCode === this.keys.BACKSPACE && typeof this.backspaceFromFilter === "function") {
|
||||
this.backspaceFromFilter(event)
|
||||
};
|
||||
if (keyCode === this.keys.TAB) this.tabFromFilter(event);
|
||||
if (keyCode === this.keys.ESC) this.escapeFromFilter(event);
|
||||
if (keyCode === this.keys.ENTER) this.enterFromFilter(event);
|
||||
|
@ -208,7 +210,6 @@ export default Ember.Mixin.create({
|
|||
upAndDownFromFilter(event) { this.didPressUpAndDownArrows(event); },
|
||||
|
||||
backspaceFromHeader(event) { this.didPressBackspace(event); },
|
||||
backspaceFromFilter(event) { this.didPressBackspace(event); },
|
||||
|
||||
enterFromHeader(event) { this.didPressEnter(event); },
|
||||
enterFromFilter(event) { this.didPressEnter(event); },
|
||||
|
|
Loading…
Reference in New Issue