Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Problem with adding caption element block to the canvas #2882

Closed
ghost opened this issue Jul 8, 2020 · 2 comments
Closed

BUG: Problem with adding caption element block to the canvas #2882

ghost opened this issue Jul 8, 2020 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 8, 2020

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

@artf
Copy link
Member

artf commented Jul 23, 2020

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

@artf artf added the bug label Jul 23, 2020
@ghost
Copy link
Author

ghost commented Jul 28, 2020

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 #1632 trying to add custom tollbar for table/cell, but maybe there's simple way or is this a bug too ?

@artf artf closed this as completed in 51039f7 Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant