Skip to content

Commit

Permalink
revert blur and focus on last chip delete (Dogfalo#24)
Browse files Browse the repository at this point in the history
Co-authored-by: zn022285 <zach.nickel@cerner.com>
  • Loading branch information
nicknickel and zn022285 authored Sep 18, 2020
1 parent 875719d commit 7f13957
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@

if (currChips.chipsData.length) {
currChips.selectChip(selectIndex);
} else {
currChips.$input[0].focus();
}

// left arrow key
Expand Down Expand Up @@ -231,7 +233,7 @@
* @param {Event} e
*/
static _handleChipsBlur(e) {
if (!Chips._keydown) {
if (!Chips._keydown && document.hidden) {
let $chips = $(e.target).closest('.chips');
let currChips = $chips[0].M_Chips;

Expand Down Expand Up @@ -268,7 +270,7 @@
}

e.preventDefault();
if (!this.hasAutocomplete || (this.hasAutocomplete && !this.options.autocompleteOnly) ) {
if (!this.hasAutocomplete || (this.hasAutocomplete && !this.options.autocompleteOnly)) {
this.addChip({
tag: this.$input[0].value
});
Expand Down

0 comments on commit 7f13957

Please sign in to comment.