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 component for handling unsaved changes #26

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

fofr
Copy link
Member

@fofr fofr commented Jun 8, 2022

Sometimes users navigate away from a form before saving their changes. This can lead to users losing what they entered.

This JS warns the user if they attempt to leave the page without saving, and is based on the JS written for Apply for teacher training:
https://github.com/DFE-Digital/apply-for-teacher-training/blob/main/app/frontend/packs/warn-on-unsaved-changes.js

Usage in a prototype:
<form data-module="warn-on-unsaved-changes" ...>

Sometimes users navigate away from a form before saving their changes. This can lead to users losing what they entered.

This JS warns the user if they attempt to leave the page without saving, and is based on the JS written for Apply for teacher training:
https://github.com/DFE-Digital/apply-for-teacher-training/blob/main/app/frontend/packs/warn-on-unsaved-changes.js

Add a component in the same pattern as Edge:

Usage in a prototype:
`<form data-module="warn-on-unsaved-changes">`
@fofr fofr requested a review from paulrobertlloyd June 8, 2022 14:01
@paulrobertlloyd paulrobertlloyd merged commit d5ccf0d into main Jun 8, 2022
@paulrobertlloyd paulrobertlloyd deleted the warn-on-unsaved-changes branch June 8, 2022 15:47
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.

2 participants