Skip to content

fix: destructive modal close behavior#1138

Open
CK-7vn wants to merge 1 commit into
mainfrom
CK-7vn/modal-esc
Open

fix: destructive modal close behavior#1138
CK-7vn wants to merge 1 commit into
mainfrom
CK-7vn/modal-esc

Conversation

@CK-7vn
Copy link
Copy Markdown
Member

@CK-7vn CK-7vn commented May 26, 2026

Pre-Submission PR Checklist

  • No debug/console/fmt.Println statements
  • Unnecessary development comments removed
  • All acceptance criteria verified
  • Functions according to ticket specifications
  • Tested manually where applicable
  • Branch rebased with latest main
  • No business logic exists within the database layer

Description of the change

Fixes modal escape behavior on destructive actions like bulk user actions, and user transfers. Users can now only exit the modal through the x button, cancel, and escape key.

@CK-7vn CK-7vn requested a review from a team as a code owner May 26, 2026 20:57
@CK-7vn CK-7vn requested review from calisio and removed request for a team May 26, 2026 20:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a9666bd6-61fb-4211-829d-67c4ea73aa71

📥 Commits

Reviewing files that changed from the base of the PR and between edf64e4 and d98e622.

📒 Files selected for processing (3)
  • frontend/src/components/residents/BulkActionDialogs.tsx
  • frontend/src/components/residents/ResidentDialogs.tsx
  • frontend/src/pages/class-detail/DeleteClassModal.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Modified modals in bulk action dialogs (password reset, deactivate, delete), resident dialogs (deactivate, delete, transfer), and class deletion modal to prevent closing when clicking outside the dialog content.

Walkthrough

This PR adds the preventOutsideClose prop to FormModal instances across seven dialogs in three files: bulk action dialogs (reset password, deactivate, delete), resident dialogs (deactivate, delete, transfer), and the class deletion modal. The prop prevents users from closing these dialogs by clicking outside the modal content.

Changes

Modal Outside-Click Prevention Configuration

Layer / File(s) Summary
Bulk action dialog modal configuration
frontend/src/components/residents/BulkActionDialogs.tsx
Added preventOutsideClose prop to FormModal in BulkResetPasswordDialog, BulkDeactivateDialog, and BulkDeleteDialog to prevent dismissal on outside clicks.
Resident management dialog modal configuration
frontend/src/components/residents/ResidentDialogs.tsx
Added preventOutsideClose prop to FormModal in DeactivateDialog, DeleteDialog, and TransferDialog to prevent dismissal on outside clicks.
Class deletion modal configuration
frontend/src/pages/class-detail/DeleteClassModal.tsx
Added preventOutsideClose prop to FormModal in DeleteClassModal to prevent dismissal on outside clicks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: destructive modal close behavior' directly and clearly summarizes the main change: preventing outside-click modal closing for destructive actions across multiple dialogs.
Description check ✅ Passed The description is well-related to the changeset, providing context about the modal escape behavior fix, listing affected files with line numbers, and referencing the related Asana task.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant