GrapesJS Issues

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

829 issues found

๐Ÿ” question
#2358October 30, 2019by Uysim3 answers
3 reactions

[QUESTIONS] How to set callbacks when asset click

I can see that image has been set only with a single click on image asset. I want to close the modal even on when click. I try to set a callback on asset click But when I click on asset. The console never trigger.

artf

@Uysim you can extend the image type https://grapesjs.com/docs/modules/Assets.html#extend-asset-types Here is the original view of the image type

Uysim

@pouyamiralayi This is not correct. My question is about the callback when user click on image on assets manager. Your answer mean to close the modal immediately after it is opened

pouyamiralayi

Hi there! your answer is hereI want to close the modal even on when click. try to set a callback on asset click cheers!

#2353October 24, 2019by logeshkrishna03 answers
2 reactions

Text: New div is created every time I hit enter instead of creating a </br>

WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...

logeshkrishna0

@pouyamiralayi, Are you saying that you wont form the new div when eneter is clicked, but when you try to save it, it would consider that space or next line as new div

logeshkrishna0

@pouyamiralayi It also happen in the new version have check using the inspect element it add a div each time when click enter in text block

logeshkrishna0

Is there a reason why when inserting text a new div is created for every break instead of a standard <div class="c4840">Insert your text here. I hit enter <div data-highlightable="1">a new div is created </div> <div data-highlightable="1">...

#2350October 23, 2019by AbdiasM3 answers
14 reactions

[Question] How do I add elements/sectors to views container using a custom button in the Panel

I have added a custom button to the Panel as below: const pm = editor.Panels; pm.addButton('views', { id: 'customButton', className: '', command: { run: function (editor) { alert("Hello"); }, stop: function (editor) { } }, attributes: { class: 'fa fa-address-card-o' }, active: false, }); I would like to add custom ele...

pouyamiralayi

@AbdiasM @ko06 sorry for being late on this! based on #277 Cheers!

hc0127

Hi, @pouyamiralayi . thanks for your post. I got custom view container. But I wanna use react components on that part. Is it possible? if so, Please help me.

ko06

is this fixed?

#2349October 23, 2019by HarryChristianR1 answer
1 reactions

[Question] How can I export including code inside <script></script?>

Hi, the <a href="https://github.com/artf/grapesjs-code-editor/">code editor plugin</a> only limits me to preview the HTML & CSS and if I try to add <script></script> .. it's gone?

giorgiosjames

Do you have allowScripts enabled for your editor? const editor = grapesjs.init({ ... allowScripts: 1, });

#2348October 22, 2019by ney11No answers
0 reactions

grapesjs link is not working...it shows path but it not navigate

WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...

#2337October 17, 2019by navewi3 answers
0 reactions

[BUG / QUESTION] Deleting default styles does not work

Hello, i'm trying to delete some of the default styles of the blocks. I wrote everything I changed in a plugin. I used this function to update for example the Text Components style-defaults: editor.DomComponents.addType(.....) seen here: https://grapesjs.com/docs/modules/Components.html#update-component-type Am I gett...

pouyamiralayi

Hi there! have you tried using setStyle ? cheers.

artf

I'd expect something like this to work (update style-default) Be sure to load your plugin after the mjml one

navewi

Hello @artf, thanks for your reply. this is the exact same code, that i tried out. This one works if I use "style" instead of "style-default".

#2336October 17, 2019by adriangroch1 answer
1 reactions

[QUESTION] `RichTextEditor` update

Hi @artf , I'm thinking of opening a PR for an update on the RichTextEditor. I thought I'd run the idea past you first before getting to work on it. It proposes a change to the actions to have a state, which is an optional function that returns an integer to depict the state of each action; 1 for active, 0 for inactiv...

artf

It proposes a change to the actions to have a state, which is an optional function that returns an integer to depict the state of each action; 1 for active, 0 for inactive, -1 for disabled. Thanks for the suggestion, I think it might be a...

#2335October 16, 2019by logeshkrishna03 answers
2 reactions

Delete icon functionality in the toolbar for the link is not working

WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...

hellocaio

It is working for me... ๐Ÿค”

hellocaio

The delete icon shows up but when you click the link is not removed, correct? Are you using the latest version of GrapesJS? What browser are you using? Are you changing any properties in the model of the default component link? Post how yo...

logeshkrishna0

here is the exact picture of the delete icon which is not working The above delete icon is not working for the anchor tag but when i add span (by inspect) to the tag it will be deleted. so i want the thing to be shorted out. could you plea...

#2333October 16, 2019by Ramkumar-Murugesan2 answers
1 reactions

can't able to remove the added traits properties[QUESTION]

Hi, I can able to add the traits properties dynamically by using the following code. but the following code to remove the type name is not working this.get('traits').remove('type'); my complete traits are can anyone please help me

pouyamiralayi

Hi there! provide an id for your trait and try again based on this: `this.removeTrait('trait-id');` cheers!

artf

Use addTrait and removeTrait methods

#2325October 12, 2019by adityaMurarka1 answer
0 reactions

How to use "append" create a structure for a side-menu in the editor and also is it possible to disable a plugin on selection of another one.

[Question]: 1.) I am trying to create a hamburger sidebar for the full-screen view instead of just the mobile view. But when we have dropped the plugin, on dropping any other plugin it is not getting a proper structure on the body to separate the other content and is overlapping. Is there any way to avoid it. 2.) Also...

artf

If you need to customize a component read and understand how they work here: https://grapesjs.com/docs/modules/Components.html You have total control over the component in the canvas by using its View