Pull Request #1067: Fixed - Popup should be closed after user hit the save button! #1064

Pull Request #1067 by isonikrish
Fixed - Popup should be closed after user hit the save button! #1064 Here's a detailed pull request (PR) description following the structure you provided: --- Pull Request Details Description Issue: The modal dialog was not closing after form submission.
Impact: Users were unable to close the dialog and continue using the application as intended.
Bug: The dialog was not closing because the state update logic was not properly handled or handleClose was not being called correctly. Fixes Updated the dialog closure logic by replacing the handleClose function with direct setOpen(false) calls in the handleModalSubmit function and onClose prop of the Dialog component. This change ensures that the dialog closes immediately after form submission is processed and resolves issue #1064. Type of PR - [x] Bug fix Summary This PR addresses the issue where the modal dialog did not close after form submission. By updating the dialog closure logic to use setOpen(false) directly, the dialog now correctly closes upon form submission. The changes include: - Directly using setOpen(false) in the handleModalSubmit function after handleSubmit completes. - Setting the onClose prop of the Dialog component to () => setOpen(false) to handle closure from user interactions like clicking outside the dialog or pressing the escape key. Additional Notes - Testing: Ensure that the handleSubmit function properly handles errors to prevent issues where the dialog might close before submission is fully processed. - Consistency: Verify that the dialog closure behavior is consistent across different user interactions and scenarios. Checklist - [x] I have read and followed the Pull Requests and Issues guidelines. - [x] The code has been properly linted and formatted using npm run lint:fix and npm run format:fix. - [x] I have tested the changes thoroughly before submitting this pull request. - [x] I have provided relevant issue numbers, snapshots, and videos after making the changes. - [x] I have not borrowed code without disclosing it, if applicable. - [x] This pull request is not a Work In Progress (WIP), and only completed and tested changes are included. - [x] I have tested these changes locally. - [x] My code follows the project's style guidelines. - [x] I have updated the documentation accordingly. - [x] This PR has a corresponding issue in the issue tracker. --- Feel free to adjust any parts of this template based on your specific changes or additional context. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> Summary by CodeRabbit - New Features - Enhanced the PlatformModal component to ensure it closes only after the submission process is complete, improving user experience. - Bug Fixes - Resolved issues with premature modal closure during submission. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server