-
Notifications
You must be signed in to change notification settings - Fork 3k
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: android pdf scrolling issue #30050
Fix: android pdf scrolling issue #30050
Conversation
@mollfpr I will add the screencast for desktop in moment. other than that, the pr is ready for review. Thanks! |
@jjcoffee Sorry for the bump. I don't know why melvin requested review from you. |
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.
Sorry for the ping @jjcoffee I'll review the PR 🙏
@mollfpr I have added the screencast for desktop. |
Reviewer Checklist
Screenshots/VideosWeb30050.Web.mp4Mobile Web - Chrome30050.mWeb-Chrome.mp4Mobile Web - Safari30050.mWeb-Safari.mp4Desktop30050.Desktop.mp4iOS30050.iOS.mp4Android30050.Android.mp4 |
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.
@mollfpr Done. cc @Gonals |
@Gonals Friendly bump for review |
8a45cd7
to
d282473
Compare
src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.js
Outdated
Show resolved
Hide resolved
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.
Tested on the latest commit and still good.
Friendly bump @Gonals for final review.
8043738
to
e99c297
Compare
Here's what I got in my local. diff --git a/src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.js b/src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.js
index e0f3e9ab84..c56bda6972 100644
--- a/src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.js
+++ b/src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.js
@@ -1,5 +1,5 @@
-import React, {memo, useCallback, useContext, useEffect} from 'react';
import PropTypes from 'prop-types';
+import React, {memo, useCallback, useContext, useEffect} from 'react';
import AttachmentCarouselPagerContext from '@components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext';
import PDFView from '@components/PDFView';
import {attachmentViewPdfDefaultProps, attachmentViewPdfPropTypes} from './propTypes';
diff --git a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js
index 3a5f39e188..7c3949f3f9 100644
--- a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js
+++ b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js
@@ -1,11 +1,11 @@
import React, {memo, useCallback, useContext} from 'react';
-import {View, StyleSheet} from 'react-native';
+import {StyleSheet, View} from 'react-native';
import {Gesture, GestureDetector} from 'react-native-gesture-handler';
import Animated, {useSharedValue} from 'react-native-reanimated';
import AttachmentCarouselPagerContext from '@components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext';
import styles from '@styles/styles';
import BaseAttachmentViewPdf from './BaseAttachmentViewPdf';
-import {attachmentViewPdfPropTypes, attachmentViewPdfDefaultProps} from './propTypes';
+import {attachmentViewPdfDefaultProps, attachmentViewPdfPropTypes} from './propTypes';
function AttachmentViewPdf(props) {
const attachmentCarouselPagerContext = useContext(AttachmentCarouselPagerContext);
diff --git a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.ios.js b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.ios.js
index 94440e1d17..103ff29276 100644
--- a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.ios.js
+++ b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.ios.js
@@ -1,6 +1,6 @@
import React, {memo} from 'react';
import BaseAttachmentViewPdf from './BaseAttachmentViewPdf';
-import {attachmentViewPdfPropTypes, attachmentViewPdfDefaultProps} from './propTypes';
+import {attachmentViewPdfDefaultProps, attachmentViewPdfPropTypes} from './propTypes';
function AttachmentViewPdf(props) {
return ( |
src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.js
Outdated
Show resolved
Hide resolved
@mollfpr Looks like the lint test has passed. Thank you very much for the diff. It solved the issue! 🙏 |
@Gonals Friendly bump for review. 🙏 |
✋ 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/Gonals in version: 1.3.96-0 🚀
|
@HezekielT Could you check the issue? |
@mollfpr I will check it now. |
@mollfpr I already have a solution for both issues. Let me test it on all platforms and then I will raise a PR. |
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
The regression was identified elsewhere. |
@akinwale I think you meant #33756(comment), we did take the zoomed pdf into account at that time and this pr didn't cause that issue. This is the PR that cause the issue by removing it. |
Details
Users couldn’t scroll up and down smoothly in a pdf attachment due to a conflict between vertical(react-native-pdf’s) scroll event and horizontal(pager’s) scroll event. This PR aims to address this conflict by disabling pager’s scroll event when the scroll is in a vertical direction and enabling it when the scroll is in a horizontal direction.
Fixed Issues
$ #23417
PROPOSAL: #23417 (comment)
Tests
+
of the composer.Add attachment
>Choose document
> upload a multi-page pdf file.+
of the composer again.Offline tests
QA Steps
Same as
Tests
Section.PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
fixPdfScrollingIssue.mov
Android: mWeb Chrome
fixPdfScrollingIssueChrome.mov
iOS: Native
Screencast-iOS-native-Pdf-Scrolling-issue.mov
iOS: mWeb Safari
Screencast-iOS-safari-pdf-scrolling-issue.mov
MacOS: Chrome / Safari
fixScrollingIssueWeb.mov
MacOS: Desktop
Screencast-desktop-pdf-scrolling-issue.mov