From 02086b74b8e161f41c485e63bab79afc164c1519 Mon Sep 17 00:00:00 2001 From: ganning127 Date: Sun, 12 May 2024 23:20:41 +0800 Subject: [PATCH] fix bug with dnd drag drop --- stories/demos/exampleCode/dnd.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stories/demos/exampleCode/dnd.js b/stories/demos/exampleCode/dnd.js index 79e7e0617..1372eafcd 100644 --- a/stories/demos/exampleCode/dnd.js +++ b/stories/demos/exampleCode/dnd.js @@ -19,11 +19,14 @@ export default function DragAndDrop({ localizer }) { if (!allDay && droppedOnAllDaySlot) { event.allDay = true } + if (allDay && !droppedOnAllDaySlot) { + event.allDay = false; + } setMyEvents((prev) => { const existing = prev.find((ev) => ev.id === event.id) ?? {} const filtered = prev.filter((ev) => ev.id !== event.id) - return [...filtered, { ...existing, start, end, allDay }] + return [...filtered, { ...existing, start, end, allDay: event.allDay }] }) }, [setMyEvents]