Skip to content

Fix ImagePicker crashed when it works with keyboard#4231

Closed
cizhaoyang wants to merge 1 commit intofacebook:masterfrom
cizhaoyang:master
Closed

Fix ImagePicker crashed when it works with keyboard#4231
cizhaoyang wants to merge 1 commit intofacebook:masterfrom
cizhaoyang:master

Conversation

@cizhaoyang
Copy link
Copy Markdown

I want to pop-up the image picker when I press a button. But if the keyboard is active and displayed on the screen, I will get a

-[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] may only be called from the main thread.

crash error. Move present image picker view code to main thread queue is able to fix the problem.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

By analyzing the blame information on this pull request, we identified @dvcrn, @nicklockwood and @yusefnapora to be potential reviewers.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@nicklockwood
Copy link
Copy Markdown
Contributor

Those methods should already be called on the main thread due to the

- (dispatch_queue_t)methodQueue
{
  return dispatch_get_main_queue();
}

Can you please provide a sample project demonstrating the crash so I can investigate further?

trabianmatt added a commit to trabianmatt/react-native-safari-view that referenced this pull request Jan 8, 2016
If the SafariView is triggered while the keyboard is active, the following exception is thrown:

`[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] may only be called from the main thread.`

This is similar to facebook/react-native#4231, which was resolved by cizhaoyang/react-native@6dd171b.

This pull request forces the SafariViewManager to run on the main thread. See https://facebook.github.io/react-native/docs/native-modules-ios.html#threading for more details.
@mkonicek
Copy link
Copy Markdown
Contributor

Hey @cizhaoyang! Thanks for making the pull request, but we are closing it due to inactivity (115 days with no activity) to make sure all pull requests are either being worked on or closed. If you want to get your proposed changes merged, please rebase your branch with master and send a new pull request :)

Based on the comment above:

Can you please provide a sample project demonstrating the crash so I can investigate further?

@mkonicek mkonicek closed this Mar 20, 2016
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.

4 participants