-
Notifications
You must be signed in to change notification settings - Fork 25.1k
fix(iOS): modal becomes unresponsive with refresh control inside scrollable #48580
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,7 +148,9 @@ - (void)didMoveToWindow | |
| { | ||
| [super didMoveToWindow]; | ||
| if (self.window) { | ||
| [self _attach]; | ||
| dispatch_async(dispatch_get_main_queue(), ^{ | ||
| [self _attach]; | ||
| }); | ||
| } else { | ||
| [self _detach]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't we add the same in the detach? also, how come that didMoveToWindow is called in a queue that is not the main queue? These methods are called by UIKit, React Native is not calling them explicitly...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't notice any problems with detach behaviour therefore I've left the code intact. I believe this is a timing issue rather. The method is executed on UI thread as expected. See below |
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use RCTExecuteOnMainQueue instead? It avoids the jump if we are already on the main queue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all about placing the block at the end of the queue - see my response here: #48580 (comment)