Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirmation prompt in onDestroy doesn't actually work. #70

Open
yongrenjie opened this issue Nov 26, 2023 · 0 comments
Open

Confirmation prompt in onDestroy doesn't actually work. #70

yongrenjie opened this issue Nov 26, 2023 · 0 comments

Comments

@yongrenjie
Copy link
Contributor

yongrenjie commented Nov 26, 2023

// Prompt user to confirm if they navigate away from this tab
onDestroy(() => {
if (userChangesPresent && window.confirm(userChangesPromptText)) {
changes = new Map();
}
});

Even if the user doesn't press confirm, it doesn't actually stop the component from being destroyed. Need to find some other way to 'interrupt' the process

Could have some custom logic in Tabs.svelte, but that feels pretty ugly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant