Skip to content

Commit 2166223

Browse files
committed
improved beforeunload function for browser compatibility
1 parent 87f74b6 commit 2166223

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/ra-ui-materialui/src/layout/Notification.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export const Notification = (props: NotificationProps) => {
4545
useEffect(() => {
4646
const beforeunload = (e: BeforeUnloadEvent) => {
4747
e.preventDefault();
48+
const confirmationMessage = '';
49+
e.returnValue = confirmationMessage;
50+
return confirmationMessage;
4851
};
4952

5053
if (messageInfo?.notificationOptions?.undoable) {

0 commit comments

Comments
 (0)