resolved event create bug

This commit is contained in:
Kyle 2026-02-19 20:44:14 +08:00
parent d5080f59af
commit c5adc316ef

View File

@ -131,9 +131,6 @@ export default function CalendarPage() {
}; };
const handleDateSelect = (selectInfo: DateSelectArg) => { const handleDateSelect = (selectInfo: DateSelectArg) => {
// Clear the selection mirror immediately so it doesn't vanish
// jarringly when the user clicks into the form's title field
calendarRef.current?.getApi().unselect();
setSelectedStart(selectInfo.startStr); setSelectedStart(selectInfo.startStr);
setSelectedEnd(selectInfo.endStr); setSelectedEnd(selectInfo.endStr);
setSelectedAllDay(selectInfo.allDay); setSelectedAllDay(selectInfo.allDay);
@ -141,6 +138,7 @@ export default function CalendarPage() {
}; };
const handleCloseForm = () => { const handleCloseForm = () => {
calendarRef.current?.getApi().unselect();
setShowForm(false); setShowForm(false);
setEditingEvent(null); setEditingEvent(null);
setSelectedStart(null); setSelectedStart(null);
@ -169,6 +167,7 @@ export default function CalendarPage() {
editable={true} editable={true}
selectable={true} selectable={true}
selectMirror={true} selectMirror={true}
unselectAuto={false}
dayMaxEvents={true} dayMaxEvents={true}
weekends={true} weekends={true}
eventClick={handleEventClick} eventClick={handleEventClick}