jquense / react-big-calendar

gcal/outlook like calendar component
http://jquense.github.io/react-big-calendar/examples/index.html
MIT License
7.82k stars 2.23k forks source link

onSelecting gives wrong time slot when dragging cursor upwards (from desired end to desired start time) #2290

Open GitHubAcc12 opened 1 year ago

GitHubAcc12 commented 1 year ago

Check that this is really a bug

Reproduction link

https://jquense.github.io/react-big-calendar/examples/index.html?path=/docs/props--on-selecting

Bug description

Using onSelecting(), when selecting a slot by dragging upwards instead of downwards (i.e. clicking where the slot should end and moving the cursor up to the time where it should start), and then holding the mouse button down while waiting once the slot is selected, the calendar will instead select the desired start time as end time and set the start time to 00:00:00 on the selected day. When reproducing with the reproduction link, the first alert will be issued for the correct time slot, then the selection will change and also output the incorrect time slot.

Expected Behavior

No response

Actual Behavior

No response

react-big-calendar version

1.5.0

React version

18.2.0

Platform/Target and Browser Versions

macOS Monterey 12.6, Google Chrome 106.0.5249

Validations

Would you like to open a PR for this bug?

qiweiii commented 1 year ago

I have the same issue, this is affecting user experience. If someone can guide me on how to fix this, I am willing to put up a PR asap.

bu6n commented 1 year ago

I don't know if it helps, but the bug does not happen on Firefox, maybe that's a place to start?

qiweiii commented 1 year ago

Appreciate your quick response, turns out it works! Should be a bug in my code..😅

bu6n commented 1 year ago

It could potentially be a bug with react-big-calendar in Chrome also, there are 1-2 other bugs that only happen there, but I haven't looked into them yet