Open
Description
It looks like the e.preventDefault()
is not enough in some browsers (Brave is where I tested).
However, if I also do e.returnValue = ''
, it does prevent and ask if I really want to close the tab.
This would be an easy fix:
vue-use-kit/src/functions/useBeforeUnload/useBeforeUnload.ts
Lines 6 to 9 in 584bc1a
const handleBeforeUnload = (e: BeforeUnloadEvent) => {
// Show alert message only when isPageDirty is true
if (isPageDirty.value) {
e.preventDefault()
e.returnValue = '';
}
}
Metadata
Metadata
Assignees
Labels
No labels