From 570a7bc0e568a50f21b0e6abe9d47ba98cac5678 Mon Sep 17 00:00:00 2001 From: Ibrahim El-bastawisi Date: Wed, 7 Aug 2024 09:57:49 +0300 Subject: [PATCH] clean up fullscreen dialogs on unmount --- src/editor/plugins/ToolbarPlugin/Dialogs/GraphDialog.tsx | 6 ++++++ src/editor/plugins/ToolbarPlugin/Dialogs/Sketch/index.tsx | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/editor/plugins/ToolbarPlugin/Dialogs/GraphDialog.tsx b/src/editor/plugins/ToolbarPlugin/Dialogs/GraphDialog.tsx index 72ad5011..ee2097d2 100644 --- a/src/editor/plugins/ToolbarPlugin/Dialogs/GraphDialog.tsx +++ b/src/editor/plugins/ToolbarPlugin/Dialogs/GraphDialog.tsx @@ -78,6 +78,12 @@ function GraphDialog({ editor, node }: { editor: LexicalEditor, node: GraphNode closeDialog(); } + useEffect(() => { + return () => { + document.body.classList.remove('fullscreen'); + } + }, []); + return { + return () => { + document.body.classList.remove('fullscreen'); + } + }, []); + return