Howto remove mousewheel listener from com.vaadin.ui.Slider?

I have a long, scrollable page with several sliders. When scrolling the page using mousewheel, the user will accidentally change the values of sliders she has entered earlier in case the mouse cursor is located on a slider (which may happen during page scrolling as well). Thus, I would like to generally remove the handler for mousewheel scrolling from sliders.

I guess I need some JavaScript to be applied to each slider, but have no clue what this would look like. The Vaadin 7-API doesn’t offer capabilities to straight remove the mousewheel listener or handler, or am I wrong?

Unfortunately, seems currently the mouse wheel event is handled on the client side and there is no API to configure that. There are two things you can do.

  1. create your own Slider, you need to create your own classes that override VSlider, SliderConnector and Slider. For SliderConnector and Slider, there is nothing you need to do, only in Vslider, you have to override the onBrowserEvent method, and ignore the Event.ONMOUSEWHEEL event.
  2. Help to create a ticket at https://github.com/vaadin/framework/issues

I would recommend to read this thread. It is about different component that you are interested, but the patterns described there can be applied to slider’s client part also.


https://vaadin.com/forum#!/thread/11472477