Problem with adding caption element block to the canvas
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 BTW, it should be fixed...
Read full answer below β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)
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 BTW,...
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/iss...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #6409
Cannot drag to move components on mobile
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v133 Reproducible demo link https:/...
Issue #6324
Sorter.setDragHelper is not a function on block drag
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? 131.0.6778.86Reproducible demo link https://...
Issue #3731
Text element not able to be selected twice after extended with events
Version: 0.17.25 Are you able to reproduce the bug from the demo?[ ] Yes[x] No What is the expected behavior? Update a existing component o...
Issue #3243
Textable attribute not working and causing exceptions
Version: 0.16.27 to latest Are you able to reproduce the bug from the demo? Yes [ X] Yes [ ] No What is the expected behavior? insert text...
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
GrapesJS DevTools: A Developer Panel Inside Your Editor
If you've ever debugged GrapesJS with console.log(editor.getSelected()) and a dozen throwaway event listeners β this post is for you.
Tutorial
How We Built Composeit in Record Time Using GrapesJS Shadcn
Bypass foundational builder boilerplate and focus on what truly matters.
Tutorial
Ship to Production Faster: Whatβs New in GrapesJS Shadcn
Supercharge your page builder! GrapesJS Shadcn adds live drag previews, rich text / commands, dynamic data, and canvas presets to ship to prod faster.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.