Skip to content

Commit 43b3c43

Browse files
committed
Merge PR #3033 into 16.0
Signed-off-by yajo
2 parents f3a122c + 826e287 commit 43b3c43

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

web_widget_numeric_step/static/src/numeric_step.esm.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@ export class NumericStep extends FloatField {
2222
}
2323
_onWheel(ev) {
2424
ev.preventDefault();
25-
if (ev.deltaY > 0) {
26-
this._doStep("minus");
27-
} else {
28-
this._doStep("plus");
25+
if (!this._lastWheelTime) {
26+
this._lastWheelTime = 0;
27+
}
28+
const now = Date.now();
29+
const throttleLimit = 100;
30+
if (now - this._lastWheelTime >= throttleLimit) {
31+
this._lastWheelTime = now;
32+
33+
if (ev.deltaY > 0) {
34+
this._doStep("minus");
35+
} else {
36+
this._doStep("plus");
37+
}
2938
}
3039
}
3140
updateField(val) {

0 commit comments

Comments
 (0)