From 0004aa5bb4e11f79ff566682cd0bf1754cc8fc5a Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 14 Oct 2022 15:12:08 -0600 Subject: [PATCH] SearchMixin: Avoid errors if searchInputNode is not created --- api/js/etemplate/Et2Select/SearchMixin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index 0156641674..52798da2dc 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -563,8 +563,8 @@ export const Et2WithSearchMixin = >(superclass // We catch all change events, then call this._oldChange only when value changes this.removeEventListener("change", this._oldChange); - this._searchInputNode.removeEventListener("change", this._searchInputNode.handleChange); - this._searchInputNode.addEventListener("change", this._handleSearchChange); + this._searchInputNode?.removeEventListener("change", this._searchInputNode.handleChange); + this._searchInputNode?.addEventListener("change", this._handleSearchChange); }); }