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

Ask for confirmation when user triggers going Back or Forward on Playground page #379

Open
czerwinskilukasz1 opened this issue Jul 9, 2020 · 8 comments · May be fixed by #515
Open

Ask for confirmation when user triggers going Back or Forward on Playground page #379

czerwinskilukasz1 opened this issue Jul 9, 2020 · 8 comments · May be fixed by #515
Assignees
Labels
DX/CLI/Playground developer experience enhancement New feature or request

Comments

@czerwinskilukasz1
Copy link
Collaborator

After I wrote quite a long program in AskScript in Playground, I accidentally swiped on my touchpad when trying to scroll the code window and left Playground. After I came back, the code was gone.

How about we prevent swiping from doing this or ask for confirmation before leaving the page?
Alternatively we could remember the code in session or browser storage.

@czerwinskilukasz1 czerwinskilukasz1 added DX/CLI/Playground developer experience discussion A discussion is taking place, please don't work on it yet labels Jul 9, 2020
@km4
Copy link
Contributor

km4 commented Aug 4, 2020

It's a great proposal! We can catch this event on the window if we change playground code (https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload)

if you have any other options please post it.

@czerwinskilukasz1
Copy link
Collaborator Author

I was thinking of preventing swipe from going back to the previous webpage, but actually it would be great to detect going back or going forward for any reason and ask for confirmation. And if so, we should implement it for every OS.

@czerwinskilukasz1 czerwinskilukasz1 changed the title Should we prevent swipe right from exiting Playground on Mac OS? Ask for confirmation when user triggers going Back or Forward on Playground page Aug 10, 2020
@czerwinskilukasz1 czerwinskilukasz1 added enhancement New feature or request and removed discussion A discussion is taking place, please don't work on it yet labels Aug 10, 2020
@czerwinskilukasz1
Copy link
Collaborator Author

Karol, would you like to work on it?
@km4

@km4
Copy link
Contributor

km4 commented Aug 11, 2020

@czerwinskilukasz1 sure. Feel free to assign me.

@czerwinskilukasz1
Copy link
Collaborator Author

Hey @km4 , how are things going? :)

@km4
Copy link
Contributor

km4 commented Aug 24, 2020

@czerwinskilukasz1 I prefer to use beforeunload because not only back or forward detect but all events ( close window, refresh, change location). What do you think?

@czerwinskilukasz1
Copy link
Collaborator Author

@km4 , ah, I must have missed your comment, I'm sorry!
Yes, beforeunload sounds very good then.

@km4
Copy link
Contributor

km4 commented Oct 9, 2020

Ok, no problem, then I work on it. 👍

km4 added a commit to km4/askql that referenced this issue Oct 13, 2020
@mhagmajer mhagmajer linked a pull request Oct 15, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX/CLI/Playground developer experience enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants