From 1702269b65003d88d2a3d14586d6e60965986a12 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 3 Apr 2023 10:21:46 -0600 Subject: [PATCH] Api: Fix readonly category select did not load application categories Categories were loaded before attributes & application was not used --- api/js/etemplate/Et2Select/Et2SelectReadonly.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2SelectReadonly.ts b/api/js/etemplate/Et2Select/Et2SelectReadonly.ts index d82df1c58b..e2d9714241 100644 --- a/api/js/etemplate/Et2Select/Et2SelectReadonly.ts +++ b/api/js/etemplate/Et2Select/Et2SelectReadonly.ts @@ -305,23 +305,21 @@ customElements.define("et2-select-bool_ro", Et2SelectBoolReadonly); export class Et2SelectCategoryReadonly extends Et2SelectReadonly { - constructor() + protected find_select_options(_attrs) { - super(); + // Need to do this in find_select_options so attrs can be used to get proper options so.cat(this).then(_options => { this.select_options = _options; // on first load we have the value before the options arrive --> need to request an update - if (this.value && (!Array.isArray(this.value) || this.value.length)) + if(this.value && (!Array.isArray(this.value) || this.value.length)) { this.requestUpdate('value'); } }); } - - protected find_select_options(_attrs) {} } // @ts-ignore TypeScript is not recognizing that this widget is a LitElement