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 beforeunload event listener when a form is open #311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Bluenix2
Copy link
Member

This means that the browser will prompt the user before it tries to close the page, that way someone cannot accidentally close the page mid-submission.

Currently this does not work for the home a element (Python Discord logo), for some reason it does not appear to trigger the beforeunload event that we subscribe to. Further investigation could be made into adding an onclick to this element that will throw a similar prompt and potentially cancel, or find a way to also trigger beforeunload events when clicking this element.

This will make the browser prompt the user before they try to reload or close the page if they have a form open.
@janine9vn janine9vn linked an issue Dec 26, 2021 that may be closed by this pull request
@HassanAbouelela HassanAbouelela removed their request for review August 4, 2022 05:45
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

Successfully merging this pull request may close these issues.

Prevent Accidental Closing of Form
1 participant