From da7eb6c47a739147c9b3dd0229489e32c23afe58 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 2 Dec 2024 16:28:08 -0700 Subject: [PATCH] Et2Number: Special handling for width to override its min-width & max-width --- api/js/etemplate/Et2Textbox/Et2Number.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Textbox/Et2Number.ts b/api/js/etemplate/Et2Textbox/Et2Number.ts index 1c5828c5fd..61db962ddd 100644 --- a/api/js/etemplate/Et2Textbox/Et2Number.ts +++ b/api/js/etemplate/Et2Textbox/Et2Number.ts @@ -60,8 +60,8 @@ export class Et2Number extends Et2Textbox } .form-control-input { - min-width: 4em; - max-width: 7em; + min-width: var(--width, 4em); + max-width: var(--width, 7em); } .input__control { @@ -192,6 +192,11 @@ export class Et2Number extends Et2Textbox { attrs.validator = attrs.precision === 0 ? '/^-?[0-9]*$/' : '/^-?[0-9]*[,.]?[0-9]*$/'; } + if(typeof attrs.width != "undefined") + { + this.style.setProperty("--width", attrs.width); + delete attrs.width; + } super.transformAttributes(attrs); }