Issue #2822Opened June 11, 2020by Lighost0 reactions

[BUG] SVG is not visible in editor

Question

Hello, I have needed to put svg into my project so I used custom code component for this purpose. But when I copy svg content into component it shows nothing. But when I look at generated index the svg is visible. I have tried same thing in demo editor, but there it is not visible in editor and also at preview mode. I have tested it with latest Safari and latest version of Google Chrome and of course I am using latest version of GrapesJS (0.16.12).

Source of wanted svg is HERE

How it looks in editor:

How it looks in index.html (in my page)

Firstly I thought mistake might be with my svg, but then it wouldn't be visible in index. Any idea what's wrong?

Answers (2)

RJCAMJune 11, 20200 reactions

Hello @Lighost I think the issue is with that svg because this is the only that isn't working properly. This can have some code that are not being understood properly by the Custom Block itself. One solution is to save the svg locally and drop it using the default Image Block of the editor, I have tested it and it works. Also I have tested the same issue with lot's of different svg's and they are working fine.

LighostJune 11, 20200 reactions

@RJCAM Yes I know, I have already did this, like inserted SVG as img. But in my case I really need insert it as svg object – because I have to do some hover effects with fill attribute. In any case, somehow it has started be visible in editor. I don't know what I have done, because I just like 3 times changed svg class filling, and now they are visible at editor. So for me, im closing this issue, because it's solved 😄 .

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.