-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
[iOS] The document picker modal closes after opening #661
Comments
For those facing the same issue, please ensure that you do not invoke the picker from a modal, bottom sheet, or any other modal-based component. Resolving this problem involves either waiting for the modal to close before invoking the picker or completely avoiding the use of modals when making the picker call. |
@vonovak - I was experiencing this issue, and the above recommendation fixed it for me. I noticed that this scenario was reported in various issues without a reproduction case or solution, would you be interested in adding this detail to the README? I think it could save other developers significant time trying to troubleshoot in the future. |
@segicm or @jlocke2 were you by chance launching the document picker from a I am seeing the same issue and I am using I did notice some mentions over in
In particular 114 as at a total guess what I think is happening is that this document picker is getting launched before the underlying However we do get desired behaviour with the I'll dive a bit deeper on it though. |
Bug report
Summary
The document picker opens and then closes the next second. If you try to open it again, it throws the error:
Error: Warning: previous promise did not settle and was overwritten. You've called "pick" while "pick" was already in progress and has not been completed yet.
Reproducible sample code
const result = await DocumentPicker.pickSingle({ allowMultiSelection: false });
Steps to reproduce
const result = await DocumentPicker.pickSingle({ allowMultiSelection: false });
Describe what you expected to happen:
It should stay opened until some action closes it.
I managed to take a screenshot before the modal closes:
Environment info
npx react-native info
output:Library version: 9.0.1
iOS version: 16.4
The text was updated successfully, but these errors were encountered: