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

Prevent <escape> key from confirming deletions #1409

Merged
merged 1 commit into from Jan 9, 2017
Merged

Prevent <escape> key from confirming deletions #1409

merged 1 commit into from Jan 9, 2017

Conversation

ix5
Copy link
Contributor

@ix5 ix5 commented Jan 6, 2017

The Delete record button in the delete_row macro calls the window.confirm() function, which fires up a dialogue box with Ok and Cancel as options.
When dismissing this modal with Escape, an error is thrown:

uncaught exception: unknown (can't convert to string)

This somehow causes the delete_row form to be submitted, deleting the record. I expect Escape to cancel an action, not confirm it.

I've had this happen to me one too many times; this patch fixes that behaviour by catching the exception and returning false instead,

(Not sure why the build is broken, I only changed pure HTML & CSS)

@mrjoes mrjoes merged commit 5469b34 into flask-admin:master Jan 9, 2017
1 check failed
@ix5 ix5 deleted the delete-fixes branch Jan 16, 2017
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.

None yet

2 participants