grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Adding images, only the first image displays, the others show in the code but are not displayed.

Open altalker opened this issue 9 years ago • 2 comments

Adding images using get components,, only the first image displays, the others show in the code but are not displayed. See example: var domc = editor.DomComponents; __var comps = domc.getComponents(); imagecount = Math.floor((Math.random() * 10000) + 1);; comps.add("<img class=img" + imagecount.toString() + " src=" + response + "> "); comps.add("");

However, add components works fine: var comp1 = domc.addComponent({ tagName: 'img',...

altalker avatar Jul 06 '17 00:07 altalker

This what addComponent does under the hood:

addComponent(component) {
  return this.getComponents().add(component);
}

so I think you're doing something wrong from your side (in your example you add 1 image)

artf avatar Jul 06 '17 12:07 artf

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 18 '19 16:09 lock[bot]