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.

Cannot paste images from Snipping Tool

See original GitHub issue

A paste event is detected, but the images never show when you try to copy and paste images from things Windows Snipping Tool. Copying and pasting images from Google, for example, has no issues.

It seems like there is a timing issue for reading files with a base64. I have not been able to reproduce a “fix” I discovered in CodePen, but in the actual project I’m using Quill for, extending the Clipboard module and lengthening the timeout duration at the end of the default onPaste function makes pasting from Snipping Tool work. The bigger the image that needs to be pasted, the larger the duration needs to be.

Again, I am not able to reproduce a bug caused by my “fix”, but in my project, lengthening the timeout duration causes two “regular” images to be pasted. I’m throwing this part out there in case it comes up for anyone else. It may be something in my project.

Steps for Reproduction

  1. Visit my CodePen
  2. Capture an image with Windows Snipping Tool
  3. Copy the image and try to paste it in the editor
  4. No image is pasted

Expected behavior: All image pasting should behave consistently.

Actual behavior: Cannot paste images from snipping tools.

Platforms: Windows 10 (I have not tested this on others yet) Chrome 72

Version: My project uses 1.3.4, but the issue persists in 1.3.6. The CodePen is using 1.3.4.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

4reactions
ashleemboyercommented, Aug 15, 2019

Hi, @josephadah! What I ended up doing was completely overriding the paste functionality and implementing my own. This involved figuring out what exactly we wanted to support at the time including Microsoft products, code editors, and plain text. It wasn’t the most fun thing I’ve ever done, sorry I don’t have a better answer for you!

2reactions
ashleemboyercommented, Mar 15, 2019

I’ve made another CodePen where I catch the paste event on quill.root and prevent the default Quill pasting functionality. In all the cases I could come up with, it appears to work the same as the editor playground. I added the (code for drag and drop)[https://github.com/kensnyder/quill-image-drop-module/blob/master/image-drop.min.js] as well to make sure that functionality still worked for the project I’m working on.

I’d still like to better understand why Quill doesn’t work with images from Snipping Tool.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows+Shift+S cannot paste image, have to open snip ...
1 Answer 1 · go to settings -> apps -> apps & features · click on snip & Sketch · click advanced options...
Read more >
Can't save or paste an image with the new Snip & Sketch tool
The shortcut key to save the snip is 'Ctrl + S' from the keyboard. You can also 'Copy' the image to the clipboard...
Read more >
Snipping Tool does not copy to clipboard [Guaranteed Fix]
Launch the Snipping app and click on Tools. · Click on Options. · Check the Always copy snips to the clipboard option. ·...
Read more >
Fix: Snipping Tool Does Not Copy to Clipboard - Get Droid Tips
The first and foremost resolution for the “Snipping Tool Does Not Copy to Clipboard” issue is the following: ... NOTE: For users who...
Read more >
E1: MOBJ: Unable to Paste Any Snipped Images in Text Editor ...
Try to paste a snipped image (use snipping tool) inside the text editor by doing a right click within the text editor. When...
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 Hashnode Post

No results found