fix: add beforeunload logic for board in edit mode (#1531)

This commit is contained in:
Meier Lukas
2024-11-24 13:43:50 +01:00
committed by GitHub
parent 32e6b8ee45
commit 225356cc4f
3 changed files with 72 additions and 3 deletions

View File

@@ -61,7 +61,8 @@ export const UserAvatarMenu = ({ children }: UserAvatarMenuProps) => {
}, [logoutUrl, openModal, router]);
return (
<Menu width={300} withArrow withinPortal>
// We use keepMounted so we can add event listeners to prevent navigating away without saving the board
<Menu width={300} withArrow withinPortal keepMounted>
<Menu.Dropdown>
<Menu.Item onClick={toggleColorScheme} leftSection={<ColorSchemeIcon size="1rem" />}>
{colorSchemeText}