mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 16:33:17 +01:00
Api: Fix Et2Number did not respect min/max
This commit is contained in:
parent
e9b66d0988
commit
1b647d1ec2
@ -185,7 +185,9 @@ export class Et2Number extends Et2Textbox
|
||||
private handleScroll(e)
|
||||
{
|
||||
const old_value = this.value;
|
||||
this.value = "" + (this.valueAsNumber + e.detail * (parseFloat(this.step) || 1));
|
||||
const min = parseFloat(this.min ?? Number.MIN_SAFE_INTEGER);
|
||||
const max = parseFloat(this.max ?? Number.MAX_SAFE_INTEGER);
|
||||
this.value = "" + Math.min(Math.max(this.valueAsNumber + e.detail * (parseFloat(this.step) || 1), min), max);
|
||||
this.dispatchEvent(new CustomEvent("sl-change", {bubbles: true}));
|
||||
this.requestUpdate("value", old_value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user