Issue #2882Opened July 8, 2020by ghost0 reactions

BUG: Problem with adding caption element block to the canvas

Question

Version: 0.16.18

Are you able to reproduce the bug from the demo? [x ] Yes https://jsfiddle.net/triawarman/tmcoqxhp/

What is the expected behavior? When drag "caption" block to canvas, will add element <caption>Insert text here</caption>

What is the current behavior? Adding text "Insert text here" directly to the canvas, even before drop "caption" block to the canvas.

Describe the bug detailed not adding "caption" element to the canvas

Answers (2)

artfJuly 23, 20200 reactions

Actually, HTML allows <caption> only inside <table>s (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption) so, the parser will always convert it in a text node, indeed the real issue is not the caption but the render of the text node in grapesjs. This will produce the same effect

editor.Blocks.add('test', {
	label: 'My block',
	content: 'My text',
});

BTW, it should be fixed in the next release, thanks for the report

ghostJuly 28, 20200 reactions

hy @artf thanks for your reply. actually after <caption> problem, i found another problems with table, i cant drag and drop <tr> to the <table>, and <th> <td> to the <tr>

the demo code is here: https://jsfiddle.net/triawarman/tpnco4v6/

i found simmilair issue at https://github.com/artf/grapesjs/issues/1632 trying to add custom tollbar for table/cell, but maybe there's simple way or is this a bug too ?

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.