DEV Community

loading...

Discussion on: What's the longest you've ever spent debugging a single bug?

Collapse
ashleemboyer profile image
Ashlee (she/her) • Edited

I spent several weeks trying to figure out why images from Windows Snipping Tool could not paste into Quill WYSIWYG and then a couple more weeks trying to fix it and work with other kinds of text and image pastes. I even wrote an issue for it that's still open! I've changed jobs 3 times since I wrote this and now I'm back to using it again in my current work project.

Cannot paste images from Snipping Tool #2539

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.

Forem Open with the Forem app