Repository navigation
Fix pdf blinks when open it - #42333
Conversation
|
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@mananjadhav I tested a multi-page PDF and I can't scroll it on Android, basically this PR will reraise #20867 again. #20867 is the one that causes our issue here. The root cause is explained on the proposal there, but in short, it's because our Pressable component when disabled doesn't really disable the Pressable, but just pass an undefined event handler to it. App/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx Lines 139 to 143 in e8ae3c5 I think to solve both issues, we should have a new prop for Pressable called something like, |
@bernhardoj I don't completely follow what you mean? You mean in our PR or the props in general? I am not sure if we really need cc - @blimpich |
|
@mananjadhav that's how the App/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx Lines 139 to 143 in e8ae3c5 There is no |
|
and what happens if we actually add App/src/components/Pressable/GenericPressable/index.native.tsx Lines 9 to 12 in e8ae3c5 |
|
It will still be the same since we take out the |
|
Okay I am okay having a |
|
Fine by me 👍 |
|
@bernhardoj Can we work on the fix? |
|
@mananjadhav updated |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-pdf-blink.movAndroid: mWeb Chromemweb-chrome-pdf-blink.moviOS: Nativeios-pdf-blink.moviOS: mWeb Safarimweb-safari-pdf-blink.movMacOS: Chrome / Safariweb-pdf-blink.movMacOS: Desktopdesktop-pdf-blink.mov |
blimpich
left a comment
There was a problem hiding this comment.
LGTM! Waiting on merge freeze to end to merge.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 1.4.76-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.76-7 🚀
|
|
I don't understand why we manually disable the on* events manually. If we'd just pass along the disabled prop, the gesture responder would be deactivate and none of the callbacks would fire 🤔 |
|
@hannojg I don't have full context on why we do that, but one thing that I can guess is that if we use |
Details
The blink happens because we change the component tree when the pdf loads completes which will recreate the pdf component again. This PR fix it.
Fixed Issues
$ #42103
PROPOSAL: #42103 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Prerequisite: send a pdf attachment
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-05-17.at.12.37.49.mov
Android: mWeb Chrome
Screen.Recording.2024-05-17.at.12.34.02.mov
iOS: Native
Screen.Recording.2024-05-17.at.12.32.22.mov
iOS: mWeb Safari
Screen.Recording.2024-05-17.at.12.30.50.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-17.at.12.29.54.mov
MacOS: Desktop
Screen.Recording.2024-05-17.at.12.30.14.mov