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

Fix modals not being dismissed properly #26840

Closed
wants to merge 1 commit into from

Conversation

sryze
Copy link
Contributor

@sryze sryze commented Oct 13, 2019

Summary

Improve the algorithm for determining the view controller for presentation of RCTModalHostViewController.

The problem was that RCTModalHostViewManager always used the first responder view controller ([modalHostView reactViewController]), whereas it is possible that such controller also had presented another view controller on top of itself (and that one could present yet another VC, and so on). So we walk through the presentedViewController chain to find the top-most presented VC.

These changes fix a bug where if you present 2 modals on top of each other, you would not be able to click on anything on the screen after they go away because there is a RCTModalHostView hanging around in the view hierarchy on top of everything else.

My previous pull request related to this issue: #22666 (closed).

Changelog

[iOS] [Fixed] - Fixed a bug with modals blocking user input after they are hidden

Test Plan

I have a test project that demonstrates the bug and allows one to verify this fix (bugs no. 2 and 3 in the bug list). The project is made with React 0.61.2.

@sryze sryze requested a review from shergin as a code owner October 13, 2019 13:28
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 13, 2019
Improve the algorithm for determining the view controller for presentation of
RCTModalHostViewController.

The problem was that RCTModalHostViewManager always used the first responder
view controller ([modalHostView reactViewController]), whereas it is possible
that such controller also had presented another view controller on top of
itself (and that one could present yet another VC, and so on). So we walk
through the presentedViewController chain to find the top-most presented VC.
@pull-bot
Copy link

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against 7c23a6e

@github-actions
Copy link

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 21, 2023
@github-actions
Copy link

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Component: Modal Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants