namespace-ee / react-calendar-timeline

A modern and responsive react timeline component.
MIT License
1.91k stars 613 forks source link

Issue 500 diagonal scroll trackpad #873

Open Billgonzo123 opened 1 year ago

Billgonzo123 commented 1 year ago

Issue Number: 500

Link to issue

I restored the code from v0.21.0 and it has restored the functionality of touch pad diagonal scrolling. It does seem that on most browser you must initially move your fingers in a diagonal motion because scrolling seems to be locked to the initial direction of scrolling per event.

I have added a small bit of code so that when clicking inside the calendar component it can be dragged on the X and Y axis. To do this I turned dragStartPosition into an object containing x and y scroll values. I then use dragStartPosition.y to update the windows scroll position.

I also fixed a bug with the shiftKey modifier when scrolling. deltaY was prioritized in a ternary resulting in glitchy and confusing movement when touchpad scrolling was diagonal. deltaX is now prioritized.

Billgonzo123 commented 1 year ago

The traditionalScroll prop mentioned in the issue seems to be undefined

Billgonzo123 commented 1 year ago

oops, this was supposed to be a draft!