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. |
|
@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 |
@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
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
TestsSection.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
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