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

feat: proper snapshot when having multiple modals #2121

Merged
merged 3 commits into from
May 14, 2024

Conversation

WoLewicki
Copy link
Member

@WoLewicki WoLewicki commented May 8, 2024

Description

PR handling setting a proper snapshot of a modal when it is dismissed from JS on new arch. Still does not work with Test1829

Changes

Test code and steps to reproduce

Checklist

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Notes

ios/RNSScreenStack.mm Outdated Show resolved Hide resolved
Comment on lines +1174 to +1178
if (_presentedModals.count < 2) {
_snapshot = [_controller.visibleViewController.view snapshotViewAfterScreenUpdates:NO];
} else {
_snapshot = [[_presentedModals.lastObject view] snapshotViewAfterScreenUpdates:NO];
}
Copy link
Member

@kkafar kkafar May 8, 2024

Choose a reason for hiding this comment

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

Yeah, I see.
There, most likely, still will be an issue when we dismiss a modal from different stack. I believe you can test this on Test1829 (if not present in FabricTestExample it is in TestsExample).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it does not work in such case, do we want to handle it right now?

Copy link
Member

Choose a reason for hiding this comment

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

I think we won't be really able to come up with anything different that a heuristic solution before we do proper modal presenting logic refactor.

Let's proceed now, I'll create note on our task board so that this is not forgotten.

@WoLewicki WoLewicki marked this pull request as ready for review May 13, 2024 11:53
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Answered your question

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

🤦🏻‍♂️ Now, I've answered the question

Comment on lines +1174 to +1178
if (_presentedModals.count < 2) {
_snapshot = [_controller.visibleViewController.view snapshotViewAfterScreenUpdates:NO];
} else {
_snapshot = [[_presentedModals.lastObject view] snapshotViewAfterScreenUpdates:NO];
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we won't be really able to come up with anything different that a heuristic solution before we do proper modal presenting logic refactor.

Let's proceed now, I'll create note on our task board so that this is not forgotten.

@WoLewicki WoLewicki merged commit cfcd5c3 into main May 14, 2024
5 checks passed
@WoLewicki WoLewicki deleted the @wolewicki/proper-snapshot-in-modals branch May 14, 2024 13:14
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
)

PR handling setting a proper snapshot of a modal when it is dismissed from JS on new arch. Still does not work with Test1829
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