From 43cce1940d0f0f195c3222ba0bf3406b838d16b3 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 12 Sep 2022 10:19:38 -0600 Subject: [PATCH] Fix selecting search result does not display label Infolog contact filter still filtered, but did not show label for selected search result. --- api/js/etemplate/Et2Select/SearchMixin.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index dace217ce5..562e7ea930 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -765,9 +765,13 @@ export const Et2WithSearchMixin = >(superclass // Stop timeout timer clearTimeout(this._searchTimeout); - // Remove remote options + // Remove remote options that aren't used let target = this._optionTargetNode || this; - target.querySelectorAll(".remote").forEach(o => o.remove()); + let keepers = this._selected_remote.reduce((prev, current) => + { + return ":not([value='" + current.value + "'])"; + }, ""); + target.querySelectorAll(".remote" + keepers).forEach(o => o.remove()); // Reset remaining options. It might be faster to re-create instead. this._menuItems.forEach((item) =>