Issue #1462Opened September 27, 2018by aerionTech0 reactions

Uploaded image error

Question

We have gotten GrapesJs integrated into our Angular application. We have the asset manager showing a list of images that have been uploaded. Initially, there are no images and upon dragging an image and then handling the upload the asset manager shows the correct image.

Upon uploading an image we are returning an object with one image in the data property, so the 1 image is appended to the existing. On initialisation, we are returning an object will the existing images.

The problem exists in the uploaded image, it's shown in the editor with the "missing picture" image and does not show the uploaded image. The only way I can get the uploaded image to appear is to double click on

the image and select it via the asset manager.

I have attached a video showing the current issue and how it works.

The created img tag in the editor does not have a src attribute e.g. <img data-gjs-type="image" alt="name-of-image-here.png" class="gjs-plh-image gjs-comp-selected" onmousedown="return false">

ezgif-4-1f6ead2c18

Answers (3)

aerionTechSeptember 27, 20180 reactions

Hi That worked, in the documentation, you might want to update the documentation to remove the first line in the array and only use the object version for the return data.

{ data: [ 'https://.../image.png', // ... { src: 'https://.../image2.png', type: 'image', height: 100, width: 200, }, // ... ] }

artfSeptember 29, 20180 reactions

@aerionTech right, but I think I'll update the upload function to make it understand also string items

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.