question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images not uploading when you hit return immediately after pasting

See original GitHub issue

If you haven’t already, check out our contributing guidelines for onboarding!


Expected Result:

  • The Image should upload

Actual Result:

  • The image doesn’t upload and the upload attachment modal closes

Action Performed (reproducible steps):

  • Copy an image to clipboard
  • Click on compose box in chat with user or test account
  • Paste image into compose by by typing command+v
  • immediately tap enter twice or more.
  • Observe image doesn’t upload

Workaround:

Wait a couple of seconds before hitting enter.

Platform:

Desktop App

Version Number: Desktop v.2-52 Notes/Photos/Videos: https://user-images.githubusercontent.com/22508304/111228887-35476680-85a2-11eb-970c-518ba9fdb640.mp4 **Expensify/Expensify Issue URL:**https://github.com/Expensify/Expensify/issues/157267 Upwork URL: https://www.upwork.com/jobs/~016727690d69f1c182

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
parasharrajatcommented, Mar 26, 2021

@marcaaron. Yes the solution still works without moving the keyboard events to onModalWillShow. So after pasting the image and pressing enter will not cancel the attachment Modal. But the Image will not be submitted until the modal is shown and then on pressing Enter the image will be submitted.

Updating the proposal to reflect this scenario.

1reaction
marcaaroncommented, Mar 25, 2021

These handlers are the one who submits the image. So they should be ready as early as possible. onModalShow fires after the modal are completely visible and the animation has finished thus pressing the enter won’t work immediately. Moving handlers to the onModalWillShow, make them available as soon as modal is rendered and modal comes into the visible state before animations and all those things are started.

Ok, that doesn’t sound like an optimization we need. The modal shows very quickly.

Sorry, but I didn’t get this. What check?

if (e && e.type === 'keydown' && e.key === 'Enter') {
Read more comments on GitHub >

github_iconTop Results From Across the Web

I cannot paste a photo after another photo, it replaces the fist ...
I have this problem with google Docs where I try to place a cursor after a photo so I can add text immediately...
Read more >
Paste an image from the clipboard - Microsoft Tech Community
I found this workaround that if you refresh the browser (while you are on the page where you want to paste) it works...
Read more >
How to prevent images from moving around in a Microsoft ...
Click the File menu and choose Options. · In the left pane, click Advanced. · In the Cut, Copy, Paste section, click the...
Read more >
Copy/paste from Microsoft Word triggers image upload
You can press Ctrl+Shift+V to paste as plain text. ... The Stack Exchange editor supports images, so when the clipboard offers that format,...
Read more >
Google Docs: Inserting Images - GCFGlobal
This is because of the text wrapping settings on the image. You'll need to change the text wrapping setting if you want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found