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

Add changes you made may not have been saved message to EditableMenuItem #150

Open
AndrewLester opened this issue Jul 21, 2021 · 1 comment
Labels
dashboard This is related to the site's dashboard design This issue relates to site design
Milestone

Comments

@AndrewLester
Copy link
Member

AndrewLester commented Jul 21, 2021

We should warn users before they exit the menu page so they don't lose unsaved changes. Use this code as a template for each EditableMenuItem:

<script>
function beforeUnload(e) {
    if (saved) return;

    e.returnValue = 'Unsaved';
    return e.returnValue;
}
</script>

<svelte:window on:beforeunload={beforeUnload}/>
@AndrewLester AndrewLester added design This issue relates to site design dashboard This is related to the site's dashboard labels Jul 21, 2021
@AndrewLester AndrewLester added this to To do in Dashboard via automation Jul 21, 2021
@AndrewLester AndrewLester added this to To do in Site Design via automation Jul 21, 2021
Dashboard automation moved this from To do to Done Jul 21, 2021
Site Design automation moved this from To do to Done Jul 21, 2021
@AndrewLester
Copy link
Member Author

AndrewLester commented Jul 21, 2021

Unfortunately the current system only protects against refresh and URL bar navigation changes, NOT sveltekit routing changes. This would be a bug to report to sveltekit, but currently I don't see an easy way around this.

@AndrewLester AndrewLester reopened this Jul 21, 2021
Dashboard automation moved this from Done to In progress Jul 21, 2021
Site Design automation moved this from Done to In progress Jul 21, 2021
@JonathanOppenheimer JonathanOppenheimer added this to the Fourth Meeting milestone Jul 21, 2021
@AndrewLester AndrewLester modified the milestones: Fourth Meeting, Future Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard This is related to the site's dashboard design This issue relates to site design
Projects
Dashboard
In progress
Site Design
In progress
Development

No branches or pull requests

2 participants