-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: Modal closes immediately after launch #2114
Fix: Modal closes immediately after launch #2114
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
5ea8508
to
8820d75
Compare
going to also add @Julesssss here as a reviewer since he's got context to for issue and proposed solution. Ran out of time to get to this today but will review it first thing tomorrow. |
This is a regression for Web & Desktop. We need to regain focus when the attachment picker closes (not for mobile though) Also, it looks like we're not closing the AttachmentPicker menu when on item is selected, can we do this? IMO it's odd mobile UX to see the prior modal when cancelling from the gallery (for example) -- I would expect the modal to close as the gallery/camera/picker is launched |
I also would expect the options here to match mobile? |
I've also brought this up here: #2129 (comment)
I wasn't sure about this, I can update it to close. My logic was that if I selected gallery by mistake I can press "Cancel" and return to select something else like documents |
I don't think the options would match on mWeb, it would use the web component with the hidden input - that would bring whatever file picker the browser would display to you. It's not even possible to test it right now as this issue is also affecting mobile Chrome: #2109: It might present something like this: Depending on what the This is well documented here: https://developers.google.com/web/fundamentals/media/capturing-images |
Updated
|
Yeah, no problem. I just mentioned it in case it simplified things, clearly not :D |
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.
Some small comments
c98f119
to
6801322
Compare
Updated
|
Since React Native 0.60 to open App settings use: `Linking.openSettings()` - works on both android and ios https://stackoverflow.com/a/58026920/4834103
626d077
to
08d8d7b
Compare
Updated
Sorry this didn't work. 😞 You can still see what changes were requested in the Conversation tab here, but they won't appear in "File Changes" I've addressed all merge conflicts and tested that this still works as expected with the latest codebase |
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.
This looks good! Gonna leave it to @Julesssss for the final review + merge.
Toggling the keyboard on the simulator will switch between these behaviors. Though for a real device the keyboard will always pop out (unless the device is connected to an external keyboard)
I would put this in your testing steps so that QA knows to do this if they're using a simulator. Otherwise they might think there's an issue with the PR.
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.
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.
Whoops, forget that last review -- the option has just been renamed to 'Upload Photo'. Outside of the scope of this PR.
Edit: we found an issue in mWeb. |
This issue was reproducible in mWeb iOS only. On mWeb Android it was working as expected. Title: Expected ResultThe 3 attachment options appear. Actual ResultNothing happens after clicking the upload photo button Action Performed
PlatformmWeb iOS ✔️ Version Number: 1.0.11-0 Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Pr.2114.Mweb.mp4 |
Step 7 of the Web steps is failing only on firefox browser. Chrome browser works as expected. Title: Expected ResultAfter File Preview closes focus should be returned to the compose input field Actual ResultAfter File Preview closes focus does not return to the input field automatically Action Performed
PlatformWeb (Firefox) ✔️ Build: 1.0.13-0 Notes/Images/Videos Bug5007651_PR_2114.mp4 |
It wouldn't do anything on desktop Safari too
I've went to the point before the changes introduced here - v1.0.10-2 and the issue is still recreatable - it predates these changes |
Thanks @isagoico. We have these issues covered already: iOS mWeb - Attachment - Upload photo button does not work
Web - Firefox browser - After File Preview closes focus does not return to the input field automatically
|
Thanks for the clarification! Will check the PR off then 🙇 |
Details
Converts the existing Attachment Picker implementation to a bottom docked modal. There's a sample video in the iOS section
Notable changes:
AttachmentPicker
: Since this is a multi index component - to keep props interface uniform it was extracted to separate fileAttachmentPicker
to a class based component, preserving existing render prop interfaceFixed Issues
Fixes #1913 also fixes #2198
Tests
For web, mWeb and Desktop
Found a bug related to Safari, please use another browser to test (Chrome works): #2109
iOS/Android
Regarding field input focusing
QA Steps
Same as above
Note that the video sample is using the iOS simulator with the software keyboard toggled on:
#2114 (comment)
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS (Video)
2021-03-29.13-56-42.mp4
Android