From c84e9f454942196afc332f0505481dc888d604fb Mon Sep 17 00:00:00 2001 From: Xeno <42929153+Xenocidious@users.noreply.github.com> Date: Thu, 18 Aug 2022 11:56:07 +0200 Subject: [PATCH 1/2] bugfix/single dropdown highlight Fix for issue #300 Highlight selected value when opening single dropdown --- src/components/VSelectize.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/VSelectize.vue b/src/components/VSelectize.vue index 9aca0af..c713fbd 100644 --- a/src/components/VSelectize.vue +++ b/src/components/VSelectize.vue @@ -338,6 +338,7 @@ export default { if (!this.disabled) { this.hasFocus = !this.disabled this.$refs.input.focus() + !this.multiple ? this.activeOptionKey = this.selected[0] : '' } }, From 0a44345eaca6b713b4fc770b9ea9328709586794 Mon Sep 17 00:00:00 2001 From: Xeno <42929153+Xenocidious@users.noreply.github.com> Date: Tue, 23 Aug 2022 08:22:33 +0200 Subject: [PATCH 2/2] Added solution for visual bug Dropdown no longer highlights the previously selected option when clicking anywhere on an opened dropdown. --- src/components/VSelectize.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/VSelectize.vue b/src/components/VSelectize.vue index c713fbd..da1dec2 100644 --- a/src/components/VSelectize.vue +++ b/src/components/VSelectize.vue @@ -336,9 +336,11 @@ export default { */ onFocus() { if (!this.disabled) { + if (!this.hasFocus) { + !this.multiple ? this.activeOptionKey = this.selected[0] : '' + } this.hasFocus = !this.disabled this.$refs.input.focus() - !this.multiple ? this.activeOptionKey = this.selected[0] : '' } },