-
Notifications
You must be signed in to change notification settings - Fork 772
Deleting a user modal won't close and page won't redirect #6560
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
base: main
Are you sure you want to change the base?
Conversation
When users attempted to delete their account, the form would submit but the modal would only shrink and empty instead of properly redirecting to the /users/close_account URL. This was caused by an interaction between the modal system(s) and the form submission process. This fix: - Handles the delete button click event directly - Ensures both modal systems (Mzp.Modal and $.kbox) are properly closed - Adds a small delay before programmatically submitting the form to allow modal closing to complete - Prevents the default button submission behavior to take control of the submission flow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the account deletion modal does not close properly and fails to redirect the page upon account deletion.
- Adds a dedicated click event handler for the delete account button
- Closes both modal systems (Mzp.Modal and $.kbox) before form submission
- Delays the form submission to allow modal closing to complete
Mzp.Modal.closeModal(); | ||
} | ||
|
||
if ($.kbox) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider verifying the existence of
if ($.kbox) { | |
if (typeof $.kbox !== 'undefined') { |
Copilot uses AI. Check for mistakes.
|
||
// Directly submit the form after a small delay | ||
// This ensures the modal closing completes before submission | ||
setTimeout(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a hardcoded delay of 50ms might be brittle if modal closing is slower than expected. Consider implementing a callback from the modal closing process or extracting the delay into a clearly named constant for easier adjustments.
Copilot uses AI. Check for mistakes.
@smithellis I'm finally getting to this review. It seems that we no longer use the |
When users attempted to delete their account, the form would submit but the modal would only shrink and empty instead of properly redirecting to the /users/close_account URL. This was caused by an interaction between the modal system(s) and the form submission process.
This fix: