From 690e89157efa640722923289a783f6bb28bb4084 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 7 Oct 2022 15:33:43 -0600 Subject: [PATCH] Et2Listbox: Make rows set the height, not the max --- api/js/etemplate/Et2Select/Et2Listbox.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2Listbox.ts b/api/js/etemplate/Et2Select/Et2Listbox.ts index 75ea7235e1..51fe5c3096 100644 --- a/api/js/etemplate/Et2Select/Et2Listbox.ts +++ b/api/js/etemplate/Et2Select/Et2Listbox.ts @@ -48,7 +48,7 @@ export class Et2Listbox extends RowLimitedMixin(Et2widgetWithSelectMixin(SlMenu) } :host([rows])::part(base) { - max-height: calc(var(--rows, 5) * 1.9rem); + height: calc(var(--rows, 5) * 1.9rem); overflow-y: auto; } ` @@ -130,13 +130,16 @@ export class Et2Listbox extends RowLimitedMixin(Et2widgetWithSelectMixin(SlMenu) { new_value = [new_value] } - this.getAllItems().forEach((item) => item.checked = false); - for(let i = 0; i < new_value.length; i++) - { - const value = new_value[i]; - (this.querySelector("[value='" + value + "']")).checked = true; - } this.requestUpdate("value", oldValue); + this.updateComplete.then(() => + { + this.getAllItems().forEach((item) => item.checked = false); + for(let i = 0; i < new_value.length; i++) + { + const value = new_value[i]; + (this.querySelector("[value='" + value + "']")).checked = true; + } + }); } _optionTemplate(option : SelectOption) : TemplateResult