@github/auto-complete-element
Advanced tools
Comparing version 3.6.0 to 3.6.1
@@ -76,7 +76,7 @@ import Combobox from '@github/combobox-nav'; | ||
this.input.dispatchEvent(new Event('change')); | ||
this.container.open = false; | ||
this.close(); | ||
} | ||
onKeydown(event) { | ||
if (event.key === 'Escape' && this.container.open) { | ||
this.container.open = false; | ||
this.close(); | ||
event.stopPropagation(); | ||
@@ -86,3 +86,3 @@ event.preventDefault(); | ||
else if (event.altKey && event.key === 'ArrowUp' && this.container.open) { | ||
this.container.open = false; | ||
this.close(); | ||
event.stopPropagation(); | ||
@@ -94,3 +94,3 @@ event.preventDefault(); | ||
return; | ||
this.container.open = true; | ||
this.open(); | ||
event.stopPropagation(); | ||
@@ -101,10 +101,10 @@ event.preventDefault(); | ||
onInputFocus() { | ||
if (this.interactingWithList) | ||
return; | ||
this.fetchResults(); | ||
} | ||
onInputBlur() { | ||
if (this.interactingWithList) { | ||
this.interactingWithList = false; | ||
if (this.interactingWithList) | ||
return; | ||
} | ||
this.container.open = false; | ||
this.close(); | ||
} | ||
@@ -115,3 +115,3 @@ onCommit({ target }) { | ||
return; | ||
this.container.open = false; | ||
this.close(); | ||
if (selected instanceof HTMLAnchorElement) | ||
@@ -152,3 +152,3 @@ return; | ||
if (!query && !this.container.fetchOnEmpty) { | ||
this.container.open = false; | ||
this.close(); | ||
return; | ||
@@ -181,3 +181,3 @@ } | ||
} | ||
this.container.open = hasResults; | ||
hasResults ? this.open() : this.close(); | ||
this.container.dispatchEvent(new CustomEvent('load')); | ||
@@ -202,2 +202,4 @@ this.container.dispatchEvent(new CustomEvent('loadend')); | ||
} | ||
this.container.open = true; | ||
this.interactingWithList = true; | ||
} | ||
@@ -215,3 +217,5 @@ close() { | ||
} | ||
this.container.open = false; | ||
this.interactingWithList = false; | ||
} | ||
} |
@@ -274,11 +274,11 @@ var __defProp = Object.defineProperty; | ||
this.input.dispatchEvent(new Event("change")); | ||
this.container.open = false; | ||
this.close(); | ||
} | ||
onKeydown(event) { | ||
if (event.key === "Escape" && this.container.open) { | ||
this.container.open = false; | ||
this.close(); | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
} else if (event.altKey && event.key === "ArrowUp" && this.container.open) { | ||
this.container.open = false; | ||
this.close(); | ||
event.stopPropagation(); | ||
@@ -289,3 +289,3 @@ event.preventDefault(); | ||
return; | ||
this.container.open = true; | ||
this.open(); | ||
event.stopPropagation(); | ||
@@ -296,10 +296,10 @@ event.preventDefault(); | ||
onInputFocus() { | ||
if (this.interactingWithList) | ||
return; | ||
this.fetchResults(); | ||
} | ||
onInputBlur() { | ||
if (this.interactingWithList) { | ||
this.interactingWithList = false; | ||
if (this.interactingWithList) | ||
return; | ||
} | ||
this.container.open = false; | ||
this.close(); | ||
} | ||
@@ -310,3 +310,3 @@ onCommit({ target }) { | ||
return; | ||
this.container.open = false; | ||
this.close(); | ||
if (selected instanceof HTMLAnchorElement) | ||
@@ -347,3 +347,3 @@ return; | ||
if (!query && !this.container.fetchOnEmpty) { | ||
this.container.open = false; | ||
this.close(); | ||
return; | ||
@@ -373,3 +373,3 @@ } | ||
} | ||
this.container.open = hasResults; | ||
hasResults ? this.open() : this.close(); | ||
this.container.dispatchEvent(new CustomEvent("load")); | ||
@@ -392,2 +392,4 @@ this.container.dispatchEvent(new CustomEvent("loadend")); | ||
} | ||
this.container.open = true; | ||
this.interactingWithList = true; | ||
} | ||
@@ -404,2 +406,4 @@ close() { | ||
} | ||
this.container.open = false; | ||
this.interactingWithList = false; | ||
} | ||
@@ -406,0 +410,0 @@ }; |
{ | ||
"name": "@github/auto-complete-element", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "Auto-complete input values from server results", | ||
@@ -5,0 +5,0 @@ "repository": "github/auto-complete-element", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57132
1202