We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6227d93 commit 29a67a9Copy full SHA for 29a67a9
src/pages/Write/index.tsx
@@ -42,6 +42,17 @@ const WritePage = () => {
42
};
43
}, [resetWrite]);
44
45
+ useEffect(() => {
46
+ const navigationGuard = (e: BeforeUnloadEvent) => {
47
+ e.preventDefault();
48
+ };
49
+ window.addEventListener('beforeunload', navigationGuard);
50
+
51
+ return () => {
52
+ window.removeEventListener('beforeunload', navigationGuard);
53
54
+ }, []);
55
56
const wrapStyle = twMerge(
57
'relative p-5 w-full grow flex flex-col',
58
`${step === 'edit' && PAPER_TYPE_OBJ[paperType]}`,
0 commit comments