In my code, I invoke originalEvent.preventDefault(). But the editor shows anyway.
Code: Select all
// Prevent user from editing mandatory rows
const onBeforeCellEditShow = (e) => {
let { rowData, newValue, field, originalEvent } = e;
if (rowData["mandatory"] == true) {
originalEvent.preventDefault();
toast.current.show({
severity: "info",
summary: "Can't Edit Mandatory Appointment Fields",
detail:
"Only the Description can be Changed on Mandatory Appointment Fields Required by Dockhub",
life: 6000,
});
}
};
Here's a video showing that onBeforeCellEdit is indeed called (the toast shows), but the editor shows despite the originalEvent.preventDefault() running.
https://share.vidyard.com/watch/6J3GPbfSdnEVkwDzfaCSNT?