Skip to content

Commit

Permalink
Chips: pass event into focusMovingTo
Browse files Browse the repository at this point in the history
Fixes #611 (paper-chips throws error on focus out on Firefox)
  • Loading branch information
pauln committed Jan 8, 2017
1 parent 745789a commit 7c1b4af
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addon/components/paper-chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export default Component.extend({
}
},

inputBlur() {
if (this.focusMovingTo('.ember-power-select-option')) {
inputBlur(_, event) {
if (this.focusMovingTo('.ember-power-select-option', event)) {
// Focus has shifted to an item - don't mess with this event.
return true;
}
Expand All @@ -94,7 +94,7 @@ export default Component.extend({

this.closeAutocomplete();

if (!this.focusMovingTo('md-chips-wrap')) {
if (!this.focusMovingTo('md-chips-wrap', event)) {
this.set('focusedElement', 'none');
}
},
Expand All @@ -103,8 +103,8 @@ export default Component.extend({
this.set('focusedElement', 'chips');
},

chipsBlur() {
if (!this.focusMovingTo(this.getInput())) {
chipsBlur(event) {
if (!this.focusMovingTo(this.getInput(), event)) {
this.set('focusedElement', 'none');
}
},
Expand Down Expand Up @@ -230,7 +230,7 @@ export default Component.extend({
return this.$('.md-chip-input-container input');
},

focusMovingTo(selector) {
focusMovingTo(selector, event) {
if (!isEmpty(event) && !isEmpty(event.relatedTarget) && this.$(event.relatedTarget).is(selector)) {
return true;
}
Expand Down

0 comments on commit 7c1b4af

Please sign in to comment.