g1eb / angular-datetime-range

📅 Angular directive for datetime range input
https://rawgit.com/g1eb/angular-datetime-range/master/
MIT License
25 stars 14 forks source link

Scroll disorder with some mouses #8

Closed IbrahimHd closed 7 years ago

IbrahimHd commented 7 years ago

Hi Gleb,

The scroll feature works fine with some mouses but does not with other ones. For instance, it works perfect with a Microsoft mouse but with "E-Blue" one it moves 2-steps with a single scroll.

Do you have any clue why such thing happens?

g1eb commented 7 years ago

That's true, from what I've noticed I can say that using a mouse with a clicking scroll wheel one can make selections much more accurate than using a mouse or touchpad with smooth scroll.

As of yet I'm afraid there is no good solution, it seems hard to test this because of great diversity in mouse/touchpad hardware.

g1eb commented 7 years ago

I have an idea on how to test this.

  1. Check if binding to different events changes behavior on different hardware (for example mousewheel event is deprecated according to MDN)

  2. Set a threshold for deltaY, that is to say, jump only after scrolling a set distance (it's too sensitive on some devices right now)

The idea is to make this behavior consistent across different mouse/touchpad hardware.

IbrahimHd commented 7 years ago

Hi Gleb, I checked using scrolling with the same mouse on the time-picker of ui-bootstrap (Bootstrap in Angular-way) and it functions fine (each tic goes one step for increment/decrement) I think code needs to be "tweaked" somehow to overcome this issue. (it will be helpful if you can take a look on their code) Thnx

g1eb commented 7 years ago

Good idea :) Essentially, they are doing exactly the same thing (see code) but I noticed they don't bind to the DOMMouseScroll event so I removed that (which is deprecated anyway).

Could you test updated scroll behavior with your mouse please?

v0.2.12

IbrahimHd commented 7 years ago

Works as expected! Thnx