-
Notifications
You must be signed in to change notification settings - Fork 37
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
Losing Snippet when accidently leaving page #165
Comments
@henon thoughts? |
This is the first time somebody has complained. The feature we disabled was very annoying because it didn't care whether you saved or not. I am really not sure it is worth the time to work on this for us when almost all people seem to have no problem with the current state. |
Does the monaco editor keep track of unsaved changes? Can we leverage that? |
There's probably such a feature, but we don't have a hook for it. Currently, we're using the pure JS version of Monaco, and we haven't updated it in a very long time. I know that MSFT uses the BlazorMonaco nuget for their internal tool, and maybe we should too. Perhaps someone is willing to port it to use that instead, as I'd like to take a break from TryMud for now. (Tho it doesn't seem BlazorMonaco is being very active as well). |
There is a feature that lets you track unsaved changes within the Monaco editor. You can easily use this feature to enable and disable the alert to prevent users from leaving the page. Also if I could figure out how to get this to build and run locally, I'd be happy to make pull request, but I get some error about some settings existing twice or not existing and am to lazy to debug whats happening. |
Should be pretty much just hit and run, with VS or |
Yesterday I was working on a demo using Try.MudBlazor and in about 45 minutes into getting it to work I accidentally refreshed the page of my browser losing everything.
I am used to coding sites like Codepen that will alert the user they are about the leave and lose progress but it appears on Try.MudBlazor you just lose everything.
I noticed that issue #7 was made closed to remove this exact functionality.
My suggestion would be to do one of the following:
Only prevent leaving the page if the user has compiled and not saved. If the snippet let the user leave, if they compile again, renable until they save again.
Provide a button in the sidebar that will let the user toggle the feature on or off. This will let users who are worried about losing data to enable the functionality well leaving all other users unaffected.
The text was updated successfully, but these errors were encountered: