Merge pull request #5619 from carldenigma/master

#5618 - Updated AutoComplete to allow form submission using return
pull/5630/head
Tuğçe Küçükoğlu 2024-04-19 15:10:57 +03:00 committed by GitHub
commit f1e3ded7da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -617,16 +617,14 @@ export default {
onEnterKey(event) { onEnterKey(event) {
if (!this.overlayVisible) { if (!this.overlayVisible) {
this.focusedOptionIndex = -1; // reset this.focusedOptionIndex = -1; // reset
this.onArrowDownKey(event);
} else { } else {
if (this.focusedOptionIndex !== -1) { if (this.focusedOptionIndex !== -1) {
this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]); this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
event.preventDefault();
} }
this.hide(); this.hide();
} }
event.preventDefault();
}, },
onEscapeKey(event) { onEscapeKey(event) {
this.overlayVisible && this.hide(true); this.overlayVisible && this.hide(true);