-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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(iOS): modal becomes unresponsive with refresh control inside scrollable #48580
base: main
Are you sure you want to change the base?
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]; | ||
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... 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)