Et2Number: Special handling for width to override its min-width & max-width

This commit is contained in:
nathan 2024-12-02 16:28:08 -07:00
parent 41c2fa92e6
commit da7eb6c47a

View File

@ -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);
}