Open lyl-moon opened 1 year ago
2.1.3 react:16.13.1
// Write example code const getCalInstance = useCallback(() => calendarRef.current?.getInstance?.(), []); const onBeforeUpdateEvent = (updateData) => { console.group('onBeforeUpdateEvent'); console.log(updateData); console.groupEnd(); const targetEvent = updateData.event; const changes = { ...updateData.changes }; getCalInstance().updateEvent(targetEvent.id, targetEvent.calendarId, changes); }; <Calendar height="900px" calendars={initialCalendars} month={{ startDayOfWeek: 1 }} events={initialEvents} template={{ allday(event) { return `<span style="color: #fff; height: 80px; display: inline-block; background-color: ${event.backgroundColor};">${event.title}</span>`; }, alldayTitle(e) { return 'alldayTitle'; }, popupEdit() { return '编辑'; }, popupDelete() { return '删除'; }, popupSave() { return '保存'; }, popupUpdate() { return '更新'; }, }} // theme={theme} timezone={{ zones: [ { timezoneName: 'Asia/Shanghai', displayLabel: '北京时间', tooltip: 'UTC+09:00', }, ], }} useDetailPopup useFormPopup view={selectedView} week={{ eventView: ['allday'], taskView: false, }} ref={calendarRef} onAfterRenderEvent={onAfterRenderEvent} onBeforeDeleteEvent={onBeforeDeleteEvent} onClickDayname={onClickDayName} onClickEvent={onClickEvent} onClickTimezonesCollapseBtn={onClickTimezonesCollapseBtn} onBeforeUpdateEvent={onBeforeUpdateEvent} />
Can be edited normally
@lyl-moon Hi, it works fine in my environment. Can you upload a minimal reproduction app by codesandbox or something?
Version
2.1.3 react:16.13.1
Test Environment
Current Behavior
Expected Behavior
Can be edited normally