fix Et2Number shows scroll-buttons if disabled and allows to in/decrement value

This commit is contained in:
ralf 2024-06-13 15:29:07 +02:00
parent 0da4a9e099
commit b493063e40

View File

@ -184,6 +184,7 @@ export class Et2Number extends Et2Textbox
private handleScroll(e) private handleScroll(e)
{ {
if (this.disabled) return;
const old_value = this.value; const old_value = this.value;
let min = parseFloat(this.min ?? Number.MIN_SAFE_INTEGER); let min = parseFloat(this.min ?? Number.MIN_SAFE_INTEGER);
if(Number.isNaN(min)) if(Number.isNaN(min))
@ -208,7 +209,7 @@ export class Et2Number extends Et2Textbox
return ''; return '';
} }
return html` return this.disabled ? '' : html`
<et2-button-scroll class="et2-number__scrollbuttons" slot="suffix" <et2-button-scroll class="et2-number__scrollbuttons" slot="suffix"
part="scroll" part="scroll"
@et2-scroll=${this.handleScroll}></et2-button-scroll>`; @et2-scroll=${this.handleScroll}></et2-button-scroll>`;