You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Basic Drag n Drop example, switch to Week mode and scroll the Time view a little bit down. Then, try to resize either on the right or left an all day event ("Conference" in the following example):
An error occurs in the EventContainerWrapper file with the following message:
To my understanding, it is failing because the handleResize event is called with a RIGHT or LEFT direction whereas the code does not handle it. The update method is called with an undefined newRange variable which makes the component crash.
However, by digging a little bit in the code, I found that this behavior seems to not be expected as I understand that the EventContainerWrapper should not handle events in the Week header, only the WeekWrapper should do that. It seems that the code in the beforeSelect event of the selector of the EventContainerWrapper should return false but in the case of a scrolled Time view, it is returning true. It is due to the green section of the EventContainerWrapper node visible in my screenshot above which crosses the Week header and indicates to the EventContainerWrapper to handle the event. When the Time view is not scrolled (parent.scrollTop is 0), the green rectangle is below the Week header, it does not cross it, consequently the crash does not occur in that case.
Maybe should we take the parent.scrollTop into account when computing the pointInColumn in the case of a resize in the beforeSelect event of the selector of the EventContainerWrapper ? Also, a quick fix would be to only call update in the case of an UP or DOWN direction or if newRange is defined.
Expected Behavior
No crash when resizing an all day event in the Week mode if the Time view is scrolled down.
Actual Behavior
A crash in the EventContainerWrapper occurs when resizing an all day event in the Week mode if the Time view is scrolled down.
Check that this is really a bug
Reproduction link
https://jquense.github.io/react-big-calendar/examples/index.html?path=/docs/addons-drag-and-drop--example-1
Bug description
In the Basic Drag n Drop example, switch to Week mode and scroll the Time view a little bit down. Then, try to resize either on the right or left an all day event ("Conference" in the following example):
An error occurs in the
EventContainerWrapper
file with the following message:To my understanding, it is failing because the
handleResize
event is called with aRIGHT
orLEFT
direction whereas the code does not handle it. Theupdate
method is called with an undefinednewRange
variable which makes the component crash.However, by digging a little bit in the code, I found that this behavior seems to not be expected as I understand that the
EventContainerWrapper
should not handle events in the Week header, only theWeekWrapper
should do that. It seems that the code in thebeforeSelect
event of theselector
of theEventContainerWrapper
should returnfalse
but in the case of a scrolled Time view, it is returningtrue
. It is due to the green section of theEventContainerWrapper node
visible in my screenshot above which crosses the Week header and indicates to theEventContainerWrapper
to handle the event. When the Time view is not scrolled (parent.scrollTop
is0
), the green rectangle is below the Week header, it does not cross it, consequently the crash does not occur in that case.Maybe should we take the
parent.scrollTop
into account when computing thepointInColumn
in the case of aresize
in thebeforeSelect
event of theselector
of theEventContainerWrapper
? Also, a quick fix would be to only callupdate
in the case of anUP
orDOWN
direction or ifnewRange
is defined.Expected Behavior
No crash when resizing an all day event in the Week mode if the Time view is scrolled down.
Actual Behavior
A crash in the
EventContainerWrapper
occurs when resizing an all day event in the Week mode if the Time view is scrolled down.react-big-calendar version
1.8.2
React version
18.2.0
Platform/Target and Browser Versions
Windows / Brave
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: