Skip to content

Commit 610956e

Browse files
fix(web): Runtime error when dragging an all day event (#365)
Stemmed from 0b47a5c Where we forgot to check for all day events, since we don't handle any drag offset for all day events.
1 parent 88f8c80 commit 610956e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/web/src/views/Calendar/components/Draft/hooks/actions/useDraftActions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,13 @@ export const useDraftActions = (
184184
const x = getX(e, isSidebarOpen);
185185
const startEndDurationMin = dragStatus?.durationMin || 0;
186186

187+
const y = draft.isAllDay
188+
? e.clientY
189+
: e.clientY - draft.position.dragOffset.y;
190+
187191
let eventStart = dateCalcs.getDateByXY(
188192
x,
189-
e.clientY - draft.position.dragOffset.y,
193+
y,
190194
weekProps.component.startOfView,
191195
);
192196

0 commit comments

Comments
 (0)