🏠 back to Observable

Bug: Cannot paste preview image from copied canvas

Environment

  • Browser: Googe Chrome 74.0.3729.131
  • OS: macOS High Sierra (10.13.6)

Steps to reproduce

  1. Right-click and copy a canvas element.
  2. Open preview image dialog.
  3. Paste.

Expected result

Clipboard contents get set as new preview image.

Actual result

Message “Sorry, only PNG & JPEG files are supported.” appears.

Background

The code checks only the first of the DataTransferItems:

2 Likes

I’ve created a notebook to demo the clipboard / datatransfer contents:

3 Likes

This is now fixed. Thanks guys!

1 Like