From 39ab8801881063c54e81165177fdbba5b915fe3b Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 5 Jan 2023 16:36:03 -0700 Subject: [PATCH] Don't die if CustomFilterHeader is for a component that isn't a webcomponent, just error & use a select --- api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts b/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts index e2c2e67743..069a66fbf9 100644 --- a/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts +++ b/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts @@ -58,6 +58,11 @@ export class Et2CustomFilterHeader extends FilterMixin(Et2InputWidget(LitElement this.widgetType = "et2-" + this.widgetType; } } + if(!window.customElements.get(this.widgetType)) + { + console.error("Unknown widget type '%s'", this.widgetType); + this.widgetType = 'et2-select'; + } // @ts-ignore TS doesn't know about this.getParent() this.filter_node = loadWebComponent(this.widgetType, {...attrs, ...this.widgetOptions}, this); if(this.filter_node instanceof Et2Select)