Issue #861💬 AnsweredOpened February 12, 2018by hillelcoren0 reactions

Help adding images to the canvas

Quick answerby artf

... it adds a blank image to the canvas Can't reproduce it. Any live demo? Or at least a screencast/gif?

Read full answer below ↓

Question

I've followed the docs and have been able to upload images.

When I drag an image block (using the newsletter preset) and select an image from the assets it adds a blank image to the canvas. I need to double click the image on the canvas and select the image again for it to show.

Is there something I need to do to wire it up? I've tried adding window.editor = editor; but it didn't fix it.

Thanks for your help!

Answers (3)

artfFebruary 13, 2018

... it adds a blank image to the canvas

Can't reproduce it. Any live demo? Or at least a screencast/gif?

hillelcorenFebruary 13, 2018

I put together a basic sample and it works, it must be a problem with my code.

hillelcorenFebruary 13, 2018

Sorry to take up your time!

If anyone else sees this problem in my case it was happening because I was using the canvas:drop event to adjust the HTML (to perform a mail merge). I've fixed it by checking if the user is dropping an image in which case we leave the HTML as is.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.