search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How not to trigger onEventClicked after canceling onEventDelete (Calendar)

Asked by jaris
1 year ago.

i have a reactjs component with DayPilotCalendar, and it has eventDeleteHandling as 'Update', whenever i call onEventDelete and then cancel the action with e.preventDefault() , it skips the action and triggering onEventClicked

          <DayPilotCalendar
            cellHeight="50"
            viewType="Day"
            startDate={date}
            onTimeRangeSelected={async (e) => {
              setStartTime(e.start.toString());
              setEndTime(e.end.toString());
              setOpenDialog(true);
            }}
            eventDeleteHandling="Update"
            onEventClicked={(event) => {
              setEventDataOfSchedule(event.e.data);
              handleClickOpen();
            }}
            events={eventData}
            onEventDelete={(event) => {
              // eslint-disable-next-line no-restricted-globals
              if (!confirm("Do you really want to delete this event?")) {
                event.preventDefault();
              }
            }}
            onEventDeleted={(event) => {
              console.log("Deleted" + event.e.data);
            }}
          />
Answer posted by Dan Letecky [DayPilot]
1 year ago.

This is a bug of the latest release. It should be fixed now in the latest sandbox build (2023.1.443):
https://release.daypilot.org/changes/jslite/

The fix will be included in the next official release.

Comment posted by jaris
1 year ago.

where can i download the dev/sandboxed version of daypilot-lite-react npm package of the said version?
https://npm.daypilot.org/ has only the pro version of dev builds

Comment posted by Dan Letecky [DayPilot]
1 year ago.

At this moment, the sandbox version of the React package is not publicly available but the next official release will be available at npmjs.com later today:

https://www.npmjs.com/package/@daypilot/daypilot-lite-react

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.