@github/auto-complete-element
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -210,3 +210,3 @@ class AutocompleteEvent extends CustomEvent { | ||
this.input.setAttribute('spellcheck', 'false'); | ||
this.mouseDown = false; | ||
this.interactingWithList = false; | ||
this.onInputChange = debounce(this.onInputChange.bind(this), 300); | ||
@@ -267,3 +267,7 @@ this.onResultsMouseDown = this.onResultsMouseDown.bind(this); | ||
onInputBlur() { | ||
if (this.mouseDown) return; | ||
if (this.interactingWithList) { | ||
this.interactingWithList = false; | ||
return; | ||
} | ||
this.container.open = false; | ||
@@ -283,6 +287,3 @@ } | ||
onResultsMouseDown() { | ||
this.mouseDown = true; | ||
this.results.addEventListener('mouseup', () => this.mouseDown = false, { | ||
once: true | ||
}); | ||
this.interactingWithList = true; | ||
} | ||
@@ -289,0 +290,0 @@ |
@@ -216,3 +216,3 @@ (function (global, factory) { | ||
this.input.setAttribute('spellcheck', 'false'); | ||
this.mouseDown = false; | ||
this.interactingWithList = false; | ||
this.onInputChange = debounce(this.onInputChange.bind(this), 300); | ||
@@ -273,3 +273,7 @@ this.onResultsMouseDown = this.onResultsMouseDown.bind(this); | ||
onInputBlur() { | ||
if (this.mouseDown) return; | ||
if (this.interactingWithList) { | ||
this.interactingWithList = false; | ||
return; | ||
} | ||
this.container.open = false; | ||
@@ -289,6 +293,3 @@ } | ||
onResultsMouseDown() { | ||
this.mouseDown = true; | ||
this.results.addEventListener('mouseup', () => this.mouseDown = false, { | ||
once: true | ||
}); | ||
this.interactingWithList = true; | ||
} | ||
@@ -295,0 +296,0 @@ |
{ | ||
"name": "@github/auto-complete-element", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Auto-complete input values from server results", | ||
@@ -5,0 +5,0 @@ "repository": "github/auto-complete-element", |
31576