Skip to content
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 contextMenu on Mobile #3659

Merged
merged 10 commits into from
Jun 29, 2021

Conversation

Viacheslav80
Copy link
Contributor

@Viacheslav80 Viacheslav80 commented Jun 17, 2021

Details

/Users/syva80/Expensify.cash/src/pages/home/report/ReportActionItemFragment.js
I'm removing the prop "selectable"

components/RenderHTML.js. --> components/RenderHTML/index.js and index.native.js (remove prop "textSelectable")

Fixed Issues

Fixes #2279

Tests

  1. Launch the app and login
  2. Select any message from LHN
  3. Long press on any message

QA Steps

Same as above

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Screenshot 2021-06-17 at 17 02 22

Desktop

iOS

Screenshot 2021-06-17 at 16 51 20

Android

Screenshot_20210618-130033

@Viacheslav80 Viacheslav80 requested a review from a team as a code owner June 17, 2021 19:57
@MelvinBot MelvinBot requested review from sketchydroide and removed request for a team June 17, 2021 19:58
Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Viacheslav80 There is far too much code duplication between the native + web implementation here. It should be very obvious what the difference between these two files are. It depends on circumstances, but a common pattern in this repo is to do something like this:

RenderHTML/
---| BaseRenderHTML // cross-platform implementation
---| index.js // lightweight web implementation wrapping cross-platform base component
---| index.native.js // leightweight native implementation wrapping cross-platform base component

Right now, it's very difficult to review this PR because the difference between the web and native implementation is not obvious.

@Viacheslav80
Copy link
Contributor Author

@roryabraham thanks. I am fix it

@Viacheslav80
Copy link
Contributor Author

Viacheslav80 commented Jun 22, 2021

Updated

src/components/RenderHTML/BaseRenderHTML.js Outdated Show resolved Hide resolved
src/components/RenderHTML/BaseRenderHTML.js Outdated Show resolved Hide resolved
src/components/RenderHTML/index.native.js Outdated Show resolved Hide resolved
src/components/RenderHTML/index.native.js Outdated Show resolved Hide resolved
src/components/RenderHTML/index.js Outdated Show resolved Hide resolved
src/components/RenderHTML/index.js Show resolved Hide resolved
@Viacheslav80
Copy link
Contributor Author

Updated

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost done! Only a couple very minor comments remaining.

src/components/RenderHTML/BaseRenderHTML.js Outdated Show resolved Hide resolved
src/components/RenderHTML/index.js Outdated Show resolved Hide resolved
@roryabraham
Copy link
Contributor

Also, there are merge conflicts

@Viacheslav80
Copy link
Contributor Author

Updated

@roryabraham
Copy link
Contributor

This does not seem to work on mobile web:

IMG_4306FE14A946-1

@Viacheslav80
Copy link
Contributor Author

exactly, something broke((

defaultProps,
} from './renderHTMLPropTypes';

const RenderHTML = ({html, debag}) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const RenderHTML = ({html, debag}) => (
const RenderHTML = ({html, debug}) => (

@Viacheslav80
Copy link
Contributor Author

Updated

@roryabraham
Copy link
Contributor

I'm observing some undesirable behavior on mobile web where the whole page is highlighted:

image

image

@Viacheslav80
Copy link
Contributor Author

Updated

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this seems to be working well now!

@roryabraham roryabraham merged commit b5a3bab into Expensify:main Jun 29, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

* @param {touchstart} e - TouchEvent.
* https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent
*/
preventDefault = (e) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we support this pattern in Class component yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I will create a follow-up to clean this up!

@parasharrajat
Copy link
Member

Just a heads up, I don't think we should have blocked the touch on the Web devices that support the Touch interface. So a check for small screens while preventing touch would have been great.

@roryabraham
Copy link
Contributor

I don't think we should have blocked the touch on the Web devices that support the Touch interface. So a check for small screens while preventing touch would have been great.

Well, this is only for PressableWithSecondaryInteraction. I guess you're saying that it won't work with a regular touch interaction?

@parasharrajat
Copy link
Member

Oh yeah. But May it will block the context menu on WEb-touch devices while using touch. Anyways we can keep it as it is for now.

@roryabraham
Copy link
Contributor

Follow-up here

@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.74-1🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@parasharrajat
Copy link
Member

@roryabraham Serious regression from blocking the touch event.

  1. Can't able to close the Edit message box. Click on cancel or save changes that are not working on Mweb.
  2. Another, mWeb iOS - Can't scroll messages #3806

@rdjuric
Copy link
Contributor

rdjuric commented Jun 29, 2021

Yea, I was trying to track when #3806 started happening and it's on this commit a1f2c94.

@roryabraham
Copy link
Contributor

Revert PR here. So @Viacheslav80 this means that you'll need to create a follow-up PR to fix the context menu on mobile web without causing other regressions.

@Viacheslav80
Copy link
Contributor Author

@roryabraham ok. I am do it today

@parasharrajat
Copy link
Member

parasharrajat commented Jun 30, 2021

@Viacheslav80 I think it's fine if you don't include the fix for blue screen/ full-page highlight. I will tackle that in #2705. But you can share your findings here about that if you want. It would be a great help, Thanks.

@kavimuru
Copy link

iOS - Chat - Context menu flickers continously

Expected Result:

No visual issues and context menu opens without any issue

Actual Result:

Context menu flickers continuously

Actions Performed:

  1. Launch the app and login
  2. Select any message from LHN
  3. Long press on any message

Platform:

iOS ✔️
mWeb
Android

Build:

1.0.75-0

Notes/Images/Video:

Bug5134006_RPReplay_Final1625058835.mp4

@isagoico
Copy link

Confirmed this is fixed #3659 (comment) 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS/Android - Message - Copy message menu is not displayed when pressing on the message
7 participants