App icon indicating copy to clipboard operation
App copied to clipboard

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

Open isagoico opened this issue 5 years ago • 37 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Expected Result:

Copy icon should appear and able to copy the message

Actual Result:

Copy icon does not appear, only device copy functionality opens up

Action Performed:

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

Workaround:

If you press directly on the text the correct menu opens.

Platform:

Where is this issue occurring?

Web iOS ✔️ Android ✔️ Desktop App Mobile Web

Version Number: 1.0.15-0

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: This was not reproducible on previous regression. The correct menu to copy the message would appear.

Video

Upwork post: https://www.upwork.com/jobs/~0117a4dc6fabf8301b

isagoico avatar Apr 07 '21 20:04 isagoico

@roryabraham not sure if we should mark this as a deploy blocker (since the copy functionality is not available in prod and it's working if you press directly on the message) please let me know what you think 😬

isagoico avatar Apr 07 '21 20:04 isagoico

No need to block deploys on this. I shall fix

roryabraham avatar Apr 07 '21 22:04 roryabraham

Issue reproducible during today's KI retests

isagoico avatar May 09 '21 22:05 isagoico

I pushed some code updates to the WIP pull request, but it's been very challenging to make this work in all cases, especially on mobile web.

roryabraham avatar May 13 '21 17:05 roryabraham

What I have on my PR branch seems to work better than on main, without introducing any new bugs. So maybe we should just merge it and get some of the improvements, even if it doesn't work perfectly. 🤷🏼‍♂️

roryabraham avatar May 13 '21 18:05 roryabraham

Issue reproducible during today's KI retests

isagoico avatar May 17 '21 01:05 isagoico

Issue reproducible during today's KI retests

isagoico avatar May 24 '21 00:05 isagoico

Issue reproducible today during KI retests

isagoico avatar May 31 '21 00:05 isagoico

My PR was pretty decayed and didn't work on all platforms, but since this can be worked on externally I think we should get this on Upwork. Hopefully my draft PR can still be a resource to the contributor that we hire to fix this issue. It's trickier than it looks! Curious to see what proposals people come up with.

roryabraham avatar Jun 04 '21 16:06 roryabraham

Triggered auto assignment to @laurenreidexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Jun 04 '21 16:06 MelvinBot

Issue reproducible today during KI retests

isagoico avatar Jun 07 '21 01:06 isagoico

https://www.upwork.com/jobs/~0117a4dc6fabf8301b

laurenreidexpensify avatar Jun 07 '21 07:06 laurenreidexpensify

I will check the call back implemented on press of text and the view that is carrying it. The problem should be somewhere in the callbacks.

raeidmir avatar Jun 07 '21 08:06 raeidmir

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

62:       -  <Text selectable
          +  <Text

https://user-images.githubusercontent.com/51112870/121068736-4e446a00-c7d5-11eb-8e91-15c2ac1d3e69.mov

Viacheslav80 avatar Jun 07 '21 18:06 Viacheslav80

@Viacheslav80 what about the case when there is markdown / html in a message? Have you thought about the other consequences of removing that prop? We still want to be able to select text to copy/paste on (desktop) web and the macOS app.

roryabraham avatar Jun 07 '21 21:06 roryabraham

@roryabraham Hi! I tested it on the web and desktop - it is copied as before. Right now, markdown is not copied in the app, moreover, it is not displayed correctly right now. It doesn't depend on whether we have this prop or not

Viacheslav80 avatar Jun 08 '21 07:06 Viacheslav80

@Viacheslav80, just removing the selectable prop from the component in that location is not an acceptable solution because it breaks the native highlight/copy functionality on the web & desktop apps.

roryabraham avatar Jun 08 '21 16:06 roryabraham

@roryabraham Ok! We can do a check: selectable={(Platform.OS == "web") ? true : false} ? Do you really not work selection in the web if you remove the "selectable" prop? it works for me on Mac (safari)

Viacheslav80 avatar Jun 08 '21 18:06 Viacheslav80

Ah, I stand corrected, it seems removing the selectable prop doesn't break native highlight selection on web + desktop. But as a result, the solution doesn't seem to work on mobile web. I tested your original solution on iOS safari and it does not seem to reliably create the correct behavior:

image

image

image

roryabraham avatar Jun 08 '21 20:06 roryabraham

@roryabraham Hi! Ok. We can do a check: 63 <Text selectable={isWeb && screenWidth >= 1024}> or do something else to check for: isMobile. Do we need the ability to highlight a part of the text on Mobile web?

https://user-images.githubusercontent.com/51112870/121528161-e58f0480-ca03-11eb-859f-c9feed161ea9.mov

Viacheslav80 avatar Jun 10 '21 12:06 Viacheslav80