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

[BugFix - Severity HIGH] Hide modal through onDismiss callback #4592

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mdaamir151
Copy link

Current behavior: When user presses outside of modal, it gets dismissed internally regardless of whether app logic wants to close the modal and then user provided callback is invoked. This results in flicker - internal close and then immediate open due to visible state still true on modal if the app logic doesn't dismiss the modal immediately. Flicker is also caused if there are frame delays between user callback being invoked and visible state being set

New Behavior: Initiate dismiss modal only when app logic sets visible state to false

Steps to reproduce bug: Pass empty function as onDismiss callback and press outside of modal - modal flickers

Motivation

Modal flickering on Android on close

modal_flicker_on_dismiss.mp4

@mdaamir151 mdaamir151 changed the title [BugFix] Hide modal through onDismiss callback [BugFix - Severity HIGH] Hide modal through onDismiss callback Jan 2, 2025
@callstack-bot
Copy link

callstack-bot commented Jan 2, 2025

Hey @mdaamir151, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

**Current behavior**: When user presses outside of modal, it gets dismissed internally regardless of whether app logic wants to close the modal and then user provided callback is invoked. This results in flicker - internal close and then immediate open due to `visible` state still `true` on modal if the app logic doesn't dismiss the modal immediately. Flicker is also caused if there are frame delays between user callback being invoked and `visible` state being set

**New Behavior**: Initiate dismiss modal only when app logic sets `visible` state to false

**Steps to reproduce bug**: Pass empty function as `onDismiss` callback and press outside of modal - modal flickers
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