From da93788c1d2dbc5acf56489fd0f637f283bbdb6f Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 14 Dec 2023 10:00:36 -0700 Subject: [PATCH] Et2Select: Fix additional entry selected after closing option list Sometimes after searching and selecting an entry from the results, when the list was closed an additional option was added --- api/js/etemplate/Et2Select/SearchMixin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index 3657536ec4..7d0e41182d 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -16,6 +16,7 @@ import {dedupeMixin} from "@open-wc/dedupe-mixin"; import {SlOption} from "@shoelace-style/shoelace"; import {Et2Textbox} from "../Et2Textbox/Et2Textbox"; import {until} from "lit/directives/until.js"; +import {waitForEvent} from "../Et2Widget/event"; // Otherwise import gets stripped let keep_import : Et2Tag; @@ -770,7 +771,7 @@ export const Et2WithSearchMixin = dedupeMixin( } this.removeAttribute("open"); - this.clearSearch(); + waitForEvent(this, "sl-after-hide").then(() => this.clearSearch()); // Reset display if(this._searchInputNode)