GrapesJS Issues

3,464 parsed GitHub issues โ€” 370 solved ยท 90 open. Search, filter and explore battle-tested answers.

829 issues found

๐Ÿ” question
#2853June 24, 2020by mikeholczer3 answers
3 reactions

[QUESTION] Do you have plans to remove dependency on Document.execCommand in RTE?

I noticed that in https://github.com/artf/grapesjs/issues/74 when the move to the Pell based editor is listed it's use of Document.execCommand was mentioned as a liability. I see now that according to https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand it's consider Obsolete, so we were wondering if...

artf

I'd like to avoid putting external libraries in the core library (indeed we still have to extract some of them). If you need quilljs you can try to add it as a custom RTE. I close it as there is no real alternative to the native API (unfor...

artf

so we were wondering if you have plans to switch to a new editor? New editor? What would be the alternative?

mikeholczer

What additional information are you looking for? I did a quick google and found https://quilljs.com/ doing a quick search of it's source on github, the only use of execCommand I see is https://github.com/quilljs/quill/blob/fd400525d551315b...

#2852June 23, 2020by RJCAM2 answers
1 reactions

[QUESTION]: Can't enable 2 panel buttons at the same time

Hi, I'm trying to enable more than one custom panel button at the same time. I think when I create some custom panel button (using code below) they will have the same behavior as normal html radio inputs, meaning that you can only select one and not more then that. See the example below when I try to enable both butto...

RJCAM

Thank you @Ju99ernaut , that's exactly what I needed.

Ju99ernaut

You have to add a different context for each button

#2850June 22, 2020by Aiyush-G3 answers
0 reactions

[QUESTION] Add Dropdown to block using Traits

Hi @artf , I hope that you are well, I was wondering whether you could help me with some simple issue that I am having (I have recently started using GrapeJS. Issue: using a plugin create a block and within the traits section have a drop down that changes the type of block displayed. Here is my current plugin code whi...

cartifon

I'm not sure if you can change the block once you added it.... Maybe you should just have classes to add to the blocks, that you can change the color, size or something like that. You can take a look on the CSS composer for it. https://gra...

artf

@Aiyush-G I think you should create a custom component with that trait which then changes the content, the block itself would just contain that component

Aiyush-G

Hi yes, this is what I was thinking, would you mind doing an example for me that changes the html content e.g. choosing red shows your chose red as a <p> tag and if you choose orange that is shows you chose orange and a <p>

#2839June 19, 2020by akashdesale981 answer
0 reactions

[Question] I added one component named template in the blocks but when i try to drag another components inside this template component ,it will be dragged but after saving it removes all the components inside it. How to avoid this?

This is code of template component: I debugged it, so i got that : setComponents method in the dom_components clearing it ...but not getting why it is removing? setComponents calls clear method which is responsible for removing elements inside it I commented this so it was working fine and persisted the components ins...

artf

<template> tag should be treated differently #244

#2833June 16, 2020by jpdigital1 answer
0 reactions

[Questions]: How to add a toolbar to a component?

Hello, I would like to extend the table component with a toolbar for adding and removing columns and rows. As far as I understood the documentation and the code the function onActive should be triggered when a component is selected. Or did I misunderstood this function? Because when I try to extend the view of the tab...

artf

Check here https://github.com/artf/grapesjs/issues/266

#2830June 14, 2020by BerkeAras3 answers
0 reactions

[QUESTIONS]: Creating Responsive Websites

Hello, is it possible to create responsive websites? For example: A text should be smaller on mobile devices and bigger on desktop. How can I do that?

artf

Yes, you have to change the device

BerkeAras

But it does not make the website responsive. I mean, isn't it possible to just make text 15px for example on mobile and 20px on desktop?

artf

When you edit in a different view those changes are saved only for that current device

#2819June 10, 2020by akashdesale981 answer
0 reactions

[Question] I am updating trait using addTrait function? It updates and adds the trait in trait manager but unable to reflect it in html section of codeManager?

I have written the following code - const component = editor.getSelected(); component.addTrait({ name: 'traitName', type: 'text', label: 'traitLabel', value: 'traitValue' }); const traits = component.get('traits'); traits.forEach(trait => console.log(trait.props()))

artf

Traits change the component (and its final HTML) when you use them. By simply updating traits collection in the component doesn't make any change to it on the HTML side

#2816June 8, 2020by scaneNo answers
0 reactions

[QUESTION]: Automatically apply style to components of similar type

Hello, I have written a custom GrapesJS component. So what I'm trying to achieve with this custom component is, if I place 2 components of the same type in the GrapesJS canvas and on editing the style of one component through style manager should automatically update the style of the other component. Is there a way to...

#2814June 5, 2020by RJCAM3 answers
2 reactions

[QUESTION] Custom panel button that dynamically Enable/Disable user scripts

Hello and thanks for sharing such a good project. I'm trying to customize some things in the editor but I have some questions that I would appreciate if they could be clarified. Recently I create a panel button to switch editor from absolute and default modes and it's working without any problem. But when I try the sa...

artf

You can change it in this way editor.getConfig().allowScripts = ...

artf

AllowScripts is for enabling parsing of JS, once the script is inserted it's executed, so you can't remove it (one way would be accessing the iframe's context and making changes manually)

RJCAM

Thank you for the response @artf . Here's the problem, the code you give me changes the value but still doesn't work as I described above. In the demo I share (https://codepen.io/RJCAM/pen/xxZbNLw) I have a button that shows an alert when...