Merge PR #3033 into 16.0

Signed-off-by yajo
pull/3051/head
OCA-git-bot 2024-12-30 07:55:34 +00:00
commit 43b3c43ef7
1 changed files with 13 additions and 4 deletions

View File

@ -22,12 +22,21 @@ export class NumericStep extends FloatField {
} }
_onWheel(ev) { _onWheel(ev) {
ev.preventDefault(); ev.preventDefault();
if (!this._lastWheelTime) {
this._lastWheelTime = 0;
}
const now = Date.now();
const throttleLimit = 100;
if (now - this._lastWheelTime >= throttleLimit) {
this._lastWheelTime = now;
if (ev.deltaY > 0) { if (ev.deltaY > 0) {
this._doStep("minus"); this._doStep("minus");
} else { } else {
this._doStep("plus"); this._doStep("plus");
} }
} }
}
updateField(val) { updateField(val) {
return Promise.resolve(this.props.update(val)); return Promise.resolve(this.props.update(val));
} }