@vaadin/vaadin-combo-box
Advanced tools
Comparing version 5.4.9 to 5.4.10
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-combo-box", | ||
"version": "5.4.9", | ||
"version": "5.4.10", | ||
"main": "vaadin-combo-box.js", | ||
@@ -16,0 +16,0 @@ "author": "Vaadin Ltd", |
@@ -579,13 +579,33 @@ /** | ||
if (this.autoOpenDisabled) { | ||
this._focusedIndex = -1; | ||
this.cancel(); | ||
} else if (this.opened) { | ||
this._stopPropagation(e); | ||
if (this._focusedIndex > -1) { | ||
// Auto-open is disabled | ||
if (this.opened || (this.value !== this._inputElementValue && this._inputElementValue.length > 0)) { | ||
// The overlay is open or | ||
// the input value has changed but the change hasn't been committed, so cancel it. | ||
this._stopPropagation(e); | ||
this._focusedIndex = -1; | ||
this._revertInputValue(); | ||
} else { | ||
this.cancel(); | ||
} else if (this.clearButtonVisible && !this.opened && !!this.value) { | ||
this._stopPropagation(e); | ||
// The clear button is visible and the overlay is closed, so clear the value. | ||
this._clear(); | ||
} | ||
} else { | ||
// Auto-open is enabled | ||
if (this.opened) { | ||
// The overlay is open | ||
this._stopPropagation(e); | ||
if (this._focusedIndex > -1) { | ||
// An item is focused, revert the input to the filtered value | ||
this._focusedIndex = -1; | ||
this._revertInputValue(); | ||
} else { | ||
// No item is focused, cancel the change and close the overlay | ||
this.cancel(); | ||
} | ||
} else if (this.clearButtonVisible && !!this.value) { | ||
this._stopPropagation(e); | ||
// The clear button is visible and the overlay is closed, so clear the value. | ||
this._clear(); | ||
} | ||
} | ||
@@ -592,0 +612,0 @@ } |
@@ -232,3 +232,3 @@ /** | ||
static get version() { | ||
return '5.4.9'; | ||
return '5.4.10'; | ||
} | ||
@@ -362,8 +362,4 @@ | ||
// to clear the value. | ||
// We need to set this listener for "this.inputElement" | ||
// instead of just "this", otherwise keyboard navigation behaviour | ||
// breaks a bit on Safari and some related tests fail. | ||
this.inputElement.addEventListener('keydown', e => { | ||
this.addEventListener('keydown', e => { | ||
if (this._isEventKey(e, 'esc')) { | ||
this._stopPropagation(e); | ||
// Trigger _onEscape method of vaadin-combo-box-mixin because | ||
@@ -370,0 +366,0 @@ // bubbling phase is not reached. |
145812
3723