mongoplayground icon indicating copy to clipboard operation
mongoplayground copied to clipboard

Display exit confirmation before leaving playground

Open IAMOTZ opened this issue 5 years ago • 1 comments

Hi there!

Context A lot of times when I'm using this awesome tool to debug MongoDB queries, I spend a considerable amount of time creating a sample collection of data in the playground. If for any reason, I mistakenly navigate away from the page or do anything that causes the page to reload, I lose all the data, both the sample collection and the potential fixed query. I've tried to be very careful when using the tool to avoid situations like this, however, I'm pretty sure I'm not the only one experiencing this, so how about we fix the issue once and for all.

Request I figured it would be great if we can use the browser beforeUnload event to confirm user action of leaving the page. With this, when a user makes an attempt to leave the page mistakenly or not, a modal pops up to confirm the user action, if user really wants to leave the page, user confirms the action and if not user happily discontinue the exit.

IAMOTZ avatar Mar 12 '20 20:03 IAMOTZ

Hi @IAMOTZ, thanks for the issue! I totally agree with you that it can be really painfull to lose all unsaved data I'll experiment a bit and see if I can find a fix

feliixx avatar Mar 15 '20 22:03 feliixx