Vaadin23 IntegerField disable value change on mouse scroll button

Viewed 40

Is it possible to disable the value change effect on the mouse scroll for the IntegerField component? If so, could you please show me how it is possible?

1 Answers

The scrolling behaviour comes from the browser and there isn't any direct feature for disabling it. It's still possible to do it with the workaround of listening to client-side scroll events on the element and preventing the default behaviour.

numberField.getElement().executeJs("this.focusElement.addEventListener('mousewheel', function(e) { e.preventDefault(); })");
Related