-
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 context menu when long press on url and email link #12987
Conversation
@marcochavezf @parasharrajat One of you needs to 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] |
I will start the review today |
It is much more involved than I thought. |
<TouchableWithoutFeedback | ||
onPress={props.onPreviewPressed} | ||
onPressIn={() => props.isSmallScreenWidth && canUseTouchScreen() && ControlSelection.block()} | ||
onPressOut={() => ControlSelection.unblock()} | ||
onLongPress={showContextMenu} | ||
> |
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.
I didn't expect these to be changed. But let me test these first.
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.
Started review.
Sorry for the delay on this. I am currently away. I will actively review it when I am back. |
Hi @b1tjoy, could you fix the conflicts? |
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.
Thanks for the changes @b1tjoy, the code LGTM so far! I'm leaving a few comments:
src/components/HTMLEngineProvider/HTMLRenderers/PreRenderer/index.js
Outdated
Show resolved
Hide resolved
Apologies for the delay on this, I was on/off for the last two weeks. My first thought is that solution is very complex and complex than what I thought it be. I will try to simplify it or remove unnecessary changes. Normally, I suggest breaking it into multiple PRs but it is fine. I will start testing and the review. |
Hi @parasharrajat, let me know if you're actively reviewing this PR, happy to help to review/test it in spare cycles if not. |
Happy to have hands on this. |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-01-12.at.12.02.40.movMobile Web - ChromeScreen.Recording.2023-01-12.at.15.56.06.movMobile Web - SafariScreen.Recording.2023-01-12.at.15.47.32.movDesktopScreen.Recording.2023-01-12.at.16.03.47.moviOSScreen.Recording.2023-01-12.at.17.06.38.movAndroidScreen.Recording.2023-01-12.at.16.10.05.mov |
Hi @b1tjoy, could you fix again the conflicts? I was OOO, apologies for the delay here. I'm going to continue reviewing it asap once the conflicts are resolved 🙇🏽 |
@marcochavezf Sorry for my late response. Conflicts 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.
LGTM, I tested all possible scenarios, and seems everything is working fine 👍🏽 Thanks @b1tjoy for all the effort here!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Lolz, I was finally reviewing it. But it is fine I will still check for code patterns. |
🚀 Deployed to staging by @marcochavezf in version: 1.2.54-0 🚀
|
🚀 Deployed to production by @AndrewGable in version: 1.2.54-2 🚀
|
Heyy, coming from this #14301 issue. Our contributors find this PR introduces the issue, specifically the usage of Thank you! |
Going through the issue and PR, it looks like the changes made in this PR is intended to solve the issue in native and mWeb or particularly touch screen devices. This issue reported suggest that the feature of long press should not be available for Web and Desktop. So, we prevented the Long Press Context Menu for Web and Desktop with these changes |
Details
When long press on URL/email link in comment, "Copy URL to clipboard" or "Copy e-mail to clipboard" does not show, this PR fix it by replace
LongPressGestureHandler
withPressable
inPressableWithSecondaryInteraction
.Because of the limitation of gesture responder system of react-native, only the inner
Pressable
in a nestedPressable
tree can catch long press event, and because of the limitation of react-native-render-html, we can not pass necessary data to the innerPressable
to display context menu. So we use React Context API to let the inner pressable component display context menu in it's long press event handler.But use
Pressable
cause some regressions, this PR fix the regressions too. Regressions need to notice:Since we can pass props data to
IOUAction
inReportActionItem
, I use prop drilling to fix regressions with IOU card rather than Context API.Fixed Issues
$ #8311
PROPOSAL: #8311 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting 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)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting 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
have been tested & I retested again)/** 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)Screenshots/Videos
Web
macOS-Chrome-2022-11-24-155600.mp4
Mobile Web - Chrome
Android-Chrome-2022-11-24-155904.mp4
Mobile Web - Safari
iOS-Safari-2022-11-24-155428.mp4
Desktop
macOS-Desktop-2022-11-24-161527.mp4
iOS
iOS-native-2022-11-24-154812.mp4
Android
Android-native-2022-11-24-161045.mp4