const id = pickedEvent !== undefined ? pickedEvent.e.data.id : "-1";
let event = calendarRef.current!.control.events.find(id);
// console.log("E' QUI CHE DIVENTA 1");
if (event !== null) {
const clientId = event?.data.tag.client_id;
// console.log("[DAYPILOT] UPDATE");
// console.log("NOTE", note);
calendarRef.current!.control.events.update({
id: id,
text: pickedService[0].service.id_service,
start: pickedService[0].date!["start"],
end: pickedService[0].date!["end"],
resource: pickedService[0].resource.id,
cssClass: "draft_event",
barHidden: true,
tag: {
marker: pickedService[0].service.ec_color_light,
client:
(watchFields.name ?? "Passaggio ") +
" " +
(watchFields.surname ?? gender),
service: pickedService[0].service.name,
writtenNote: note,
note: note !== undefined,
},
});
Why this code causes flickering in all the calendar when called? I would like only the event to be updated, but everything is redrawn.