Src is stored twice with image
@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
Read full answer below ↓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)
@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
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.
Issue #2196
[Bug] Link element selection shows no toolbar
Steps to reproduce: add Text, select a word, click on Link icon in RTE panel, select a Link. Expected behaviour: when I select Link I expec...
Issue #1567
rte toolbar bug
Hello all, I am using the latest grapesjs stable version (40) and I noticed the following bug in the rich text editor: If the user drags an...
Issue #2207
[BUG]: Can't drag component if there is some space on top/left with Mode Absolute
Given the following code example... Results in no ability to drag and drop elements to correct position using drag icon on the panel. See F...
Issue #2364
[Question] How to add toolbar functionality to the layers panel.
I am trying to add the toolbar to the layers panel and I am not sure how to go about this. Is there any way to accomplish this? toolbar Whe...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →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.
Tutorial
Super Tooltip for GrapesJS — Version 0.1.5 Released 🎉
We’re excited to announce the v 0.1.5 update of Super Tooltip, our floating‑menu and tooltip plugin for GrapesJS
Tutorial
GrapesJS in 2026: The Complete Guide to the Open-Source Web Builder Framework
Master GrapesJS in 2026. Architecture, code examples, React integration, plugin development, Studio SDK, and how it compares to other projects
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.