-
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 pdf blinks when open it #42333
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 |
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.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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