Skip to content

fix: prevent ExpandableOverlay onDismiss callback from being called twice#3916

Merged
adids1221 merged 3 commits intomasterfrom
fix/ExpandableOverlay_onDismiss_called_twice
Feb 5, 2026
Merged

fix: prevent ExpandableOverlay onDismiss callback from being called twice#3916
adids1221 merged 3 commits intomasterfrom
fix/ExpandableOverlay_onDismiss_called_twice

Conversation

@adids1221
Copy link
Contributor

@adids1221 adids1221 commented Jan 20, 2026

Description

Fixes an issue where the onDismiss callback passed via modalProps or dialogProps was being called twice when the overlay was dismissed.

The issue occurred because closeExpandable was being triggered from multiple sources:

  1. From onBackgroundPress / onRequestClose when user dismissed the modal
  2. From React Native Modal's internal onDismiss callback

Added a new dismissOverlay function that only closes the UI without calling the user's callback. Modal's onDismiss now uses dismissOverlay, while onBackgroundPress and onRequestClose continue to use closeExpandable.

Verified that components using ExpandableOverlay are not affected:

  • Picker - all tests pass
  • DateTimePicker - all tests pass

Changelog

ExpandableOverlay - Fixed onDismiss callback being called twice when modal is dismissed.

Additional info

MADS-4656
Old PR (Closed because of conflicts, all the comments there are fixed here)

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

✅ PR Description Validation Passed

All required sections are properly filled out:

  • Description
  • Changelog
  • Additional info

Your PR is good for review! 🚀


This validation ensures all sections from the PR template are properly filled.

@adids1221
Copy link
Contributor Author

TODO: check on private repo

@M-i-k-e-l
Copy link
Collaborator

TODO: check on private repo

Did you test it?

@adids1221
Copy link
Contributor Author

TODO: check on private repo

Did you test it?

It's in my task list, but I can't build private version with the current builds issue.

@adids1221
Copy link
Contributor Author

Hi @M-i-k-e-l,
Verified in private repo using snapshot 8.2.2-snapshot.7711
Tested components that use ExpandableOverlay:

  • Picker - onDismiss called once ✅
  • ActionSheet - onDismiss called once ✅
  • TimePicker - value reset on dismiss ✅
  • DatePicker - value reset on dismiss ✅
  • DurationPicker - value reset on dismiss ✅

Tested scenarios:

  • Background tap dismiss
  • Selection dismiss

No regressions found.

Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to update private and make sure tests pass there

@M-i-k-e-l M-i-k-e-l assigned adids1221 and unassigned M-i-k-e-l Feb 5, 2026
@adids1221 adids1221 merged commit 3837690 into master Feb 5, 2026
4 checks passed
@adids1221 adids1221 deleted the fix/ExpandableOverlay_onDismiss_called_twice branch February 5, 2026 08:04
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.

2 participants