GrapesJS Issues

3,464 parsed GitHub issues β€” 370 solved Β· 90 open. Search, filter and explore battle-tested answers.

644 issues found

πŸ” components
#2937August 4, 2020by MattDBP1 answer
1 reactions

Question: RTE in Modal

Hello, I'm trying to get TinyMCE to work as an editor in a modal instead of inline. I am able to get the selected components html with target.getEl().innerHTML but this doesn't include any styling. When setting the content back with replaceWith(html) all styling is lost on the component. Is there a way to update/repla...

Ju99ernaut

You can use this to get a component and it's style;

#2918July 25, 2020by neon123453 answers
0 reactions

BUG: textnode is not removed from canvas

Text imported directly to the wrapper is not removed from the canvas with the component. To verify one can import simple texts multiple times to the demo and watch how they combine instead of replacing the previous one. Adding this seems to help: editor.DomComponents.addType('textnode', { model: { removed() { var el =...

artf

I don't follow your example, can you illustrate exact steps to reproduce, please?

neon12345

Go to the newsletter demo at https://grapesjs.com/demo-newsletter-editor.html and use the "Import template" function with simple text like "hello" but no html (or combine it with html and text on the root level). Repeat this and the text o...

artf

Thanks @neon12345, I was able to find the issue and it should be fixed in the next release

#2913July 23, 2020by neon123452 answers
1 reactions

BUG: src is stored twice with image

The output of "JSON.stringify(editor.getComponents())" shows that the src of an image is stored twice. { "type": "image", "void": true, "status": "selected", "content": "", "attributes": { "id": "iy3c7", "src": "data:image/png;base64,..." <--- 1. }, "src": "data:image/png;base64,...", <--- 2. "activeOnRender": 0, "ope...

artf

@longdoan7421 I think we can delete it in toJSON method when the src is equal to attribute.src and ensure is loaded back correctly on load

longdoan7421

Hi @artf, I just took a quick look through ComponentImage. I think it is possible to drop the src property in image model and replace the code which use src in ComponentImage and ComponentImageView with the attribute.src. But I am not sure...

#2909July 21, 2020by tvvignesh2 answers
0 reactions

FEAT: Support for search and commands in the editor for custom components

Hi. First of all, awesome work with grapesjs. Had a feature request which may greatly improve usability for users. While grapesjs does allow to categorize components like these: It will be great if there is support for searching components to import and import them (a normal filter from the sidebar would also do). Thi...

artf

Hi @tvvignesh for sure it makes sense but as you know UIs related stuff are highly arguable so it requires a lot of code to make it as much customizable as possible. So far, I've stopped adding UI stuff in the core and started making it mo...

tvvignesh

@artf Thanks for your inputs on this. Will try implementing using Blocks API. Just one question though. Since I would like to add blocks in the location where the cursor is by searching for the block as in the screenshot, may I know the re...

#2893July 14, 2020by Hsin903211 answer
0 reactions

[Question] Can I set for loop value in components render?

Hi,I'm beginner in grapesjs. I want to make a question number by for loop when I dropped components, ↓I want final like this image. the div can show for loop number. ↓my component's code In render, I divided the my default html questionCom from {{i}} into front and back. then,put them in render. {{i}} can perfect to s...

artf

Use the questionCom you're passing to the model (use model to update model related logic) and I'd suggest using API from the Components documentation (eg. textType.view.extend is the old one)

#2873July 3, 2020by RJCAM3 answers
3 reactions

[BUG]: Some form components not working well with Preset Webpage Plugin

Hi, I've noticed that some form components (like checkbox, radio and select) are not working when gjs is initialized with the Preset Webpage Plugin like in the example below: You can confirm this issue with the online Webpage Demo too https://grapesjs.com/demo.html Expected Behavior: can select all of them normally (o...

artf

Ah ok, now I got it. Yeah, forms plugin avoids some default input behavior, so it's intended. I agree that in the preview mode those behaviors could be re-enabled but I think that part might be integrated as a plugin (eg. by using event li...

RJCAM

Hum...ok, I'll try to do that, thanks for the help :+1:

artf

After rebuild the plugin the behavior works as expected, so problem resolved. Maybe there is a reason why I've done that?! πŸ˜… Via plugin, you can simply extend those components and override handleClick function with your logic, where you p...

#2867July 1, 2020by Lostpixelr1 answer
0 reactions

[Question] not escape html characters in textNodes?

Hi, We are using some Twig template features in our grapesjs implementation. like: {% if variable == "value" %}<b>text</b>{% endif %} But due to the toHtml() function in src/dom_components/model/ComponentTextNode.js this gets converted into {% if variable == &quote;value&quote; %}<b>text</b>{% endif %} Is there an eas...

artf

Yeah sure, you can extend the textnode component and use your toHTML function

#2866July 1, 2020by sanjib001 answer
0 reactions

[QUESTION] How to remove empty space at end of the page for free dragging?

Hello @artf , For free dragging, we are using dragMode: 'translate'. When we're moving all components from bottom to top position, it remains some blank space at end of the page and browser shows scroll, although we don't have any content at end of the page. See screenshot - For better understanding, you can watch the...

artf

This is how translate mode works, the absolute mode doesn't leave any empty space