Skip to content

Commit

Permalink
Merge PR #3033 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by yajo
  • Loading branch information
OCA-git-bot committed Dec 30, 2024
2 parents f3a122c + 826e287 commit 43b3c43
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions web_widget_numeric_step/static/src/numeric_step.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@ export class NumericStep extends FloatField {
}
_onWheel(ev) {
ev.preventDefault();
if (ev.deltaY > 0) {
this._doStep("minus");
} else {
this._doStep("plus");
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) {
this._doStep("minus");
} else {
this._doStep("plus");
}
}
}
updateField(val) {
Expand Down

0 comments on commit 43b3c43

Please sign in to comment.