-
Notifications
You must be signed in to change notification settings - Fork 528
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
Prevent escape from closing "create pull request" modal that contains changes #5387
base: master
Are you sure you want to change the base?
Conversation
@simenbrekken is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
Thank you! I would think that pressing ESC was very intentionally linked, but I'd also expect it to ask to be sure the user is fine loosing changes they made. CC @PavelLaptev as there might be other ways to prevent the user from accidentally loosing changes without completely disabling keys. |
I've added a confirm dialog now that makes more sense. |
Maybe another way to solve this could be to save the PR description in progress in local storage, so that if one presses esc by accident, reopening the modal it will be pre-filled with the content before |
Even better! |
Agreed. I would be nice if we can do this. |
We do this for commit messages already, so seems like a very easy task imo (famous last words :D ) |
Sorry for the long wait! I somehow missed this completely
Yes! Let's do it |
This is the proposed PR for persisting the title and description: #5559 |
☕️ Reasoning
After carefully crafting a pull request description for 10 minutes, the last thing you expect is for an accidental press of escape to close the dialog and destroy your stuff.
🧢 Changes
If title or body has been changed, prompt the user to confirm before closing dialog.