jquense / react-big-calendar

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

fix(dnd): add correct dragOverFromOutside behavior in week view #2616

Open achrafl0 opened 4 months ago

achrafl0 commented 4 months ago

Hey,

This is an attempt to fix https://github.com/jquense/react-big-calendar/issues/2383.

The 2 issues I noticed were:

It's not breaking, as the old "dragOver" event was never emitted, so the code was never called (from my understanding)!

I'd love to have your feedback, and I'd be happy to add tests or better documentation if deemed necessary !

This is how it looks on the storybooks

https://github.com/jquense/react-big-calendar/assets/63306573/d8fbb4a2-80d9-4424-b344-950a6ec4c163

cutterbl commented 4 months ago

@achrafl0 I have to pull this code down and run it myself, but a quick look at you changes looks good. Give me a day or two to make sure there are no adverse effects.

cutterbl commented 4 months ago

@achrafl0 The issue I'm seeing right now occurs within that same Storybook example. There is an item there which you should not be able to drop on the calendar ("Draggable but not for calendar"). In current master it respects that in the week and day views. Attempting to drop on the timegrid does nothing. With your code it actually shows the slot preview and creates an event on drop.

matthiaseigner commented 2 months ago

Is there an update on this issue? We would also need the dragOver preview on the weeks view.

cutterbl commented 2 months ago

@matthiaseigner Just waiting on @achrafl0 to revise his PR for the feedback given.

cutterbl commented 1 week ago

@achrafl0 If you could please pull in latest changes so that I can review this again