Issue #2913Opened July 23, 2020by neon123451 reactions

BUG: src is stored twice with image

Question

The output of "JSON.stringify(editor.getComponents())" shows that the src of an image is stored twice.

             {
                "type": "image",
                "void": true,
                "status": "selected",
                "content": "",
                "attributes": {
                  "id": "iy3c7",
                  "src": "data:image/png;base64,..."                    <--- 1.
                },
                "src": "data:image/png;base64,...",                     <--- 2.
                "activeOnRender": 0,
                "open": false
              }

Version is v0.16.18 - validated with the demo.

Answers (2)

artfDecember 16, 20201 reactions

@longdoan7421 I think we can delete it in toJSON method when the src is equal to attribute.src and ensure is loaded back correctly on load

longdoan7421December 8, 20200 reactions

Hi @artf,

I just took a quick look through ComponentImage. I think it is possible to drop the src property in image model and replace the code which use src in ComponentImage and ComponentImageView with the attribute.src.

But I am not sure that do you use the src property in any where else? What do you think about that?

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.