GrapesJS Issues

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

829 issues found

๐Ÿ” question
#2083June 17, 2019by afdallah3 answers
2 reactions

[QUESTION] model.get('toolbar') always return null

Hi @artf I am trying to add a custom toolbar to my custom component without changing the default toolbar. So I expect it to be like [movable, copyable, removable, newToolbar]. I use this #266 as a reference. But strangely this.get('toolbar') always return null. Is this something normal? I got this instead

artf

The extendFn was added from https://github.com/artf/grapesjs/releases/tag/v0.14.61 in the demo you're using the 0.14.57

afdallah

I am so sorry, it's my mistake. Thanks for your guidance

artf

Yes, if you override the original initToolbar method the toolbar property is never created, so you have to call the parent one first. Try with this component creation helper

#2082June 17, 2019by ohmyvander1 answer
0 reactions

[Question]Is it possible to update existing pages when components are modified?

For example, a custom component is used by some existing published pages. When the component is modified, maybe the style is adjusted, or the content property of it is completely changed, I want to notice those pages to update, and when I preview those pages, they should be rendered with the latest component. Is it po...

artf

If the property you've changed was stored, obviously when you load the component back its properties are going on top of the component definition. So, the only solution would be to avoid storing those properties

#2076June 12, 2019by msassa3 answers
2 reactions

[QUESTION] How make a new component to allow laravel blade directives?

Hi, thanks for the nice work. I'll like to know if there is a way to use blade directives inside the code. I already add a new functionality to edit the source code, and work just fine. But when I write something like that, the canvas show a ugly text: And I like to find a way that @if don't render in the canvas. Do y...

artf

@msassa If you write the code like this, it's quite hard for the editor to understand it, but if you create a kind of custom conditional component you'll get more control over it. Here an example of your case where the condition can also b...

verdverm

What would parse that syntax during rendering? I've been looking at running react in the canvas, but we need to load react and transpile components we create. There is an in browser babel script to do something like this. Haven't got it fu...

msassa

Hi, I'm saving that code into a file, in S3. Later, I use that files in a Laravel application. Everything work fine, the only improvement I like to do, is: The code is correct as source code, and it has to be saved that way. But when I vis...

#2073June 10, 2019by AlejandroSuarezA3 answers
0 reactions

[QUESTIONS] Trouble using urlLoad

I've got an issue calling to my endpoint to load a template, it's doing a pre flight OPTIONS request but I cant find how to continue after the OK response componentDidMount() { this.editor = GrapesJS.init({ container: '#grapeEditor', plugins: [gjsPresetNewsletter], storageManager: { id: 'gjs-', type: 'remote', urlLoad...

verdverm

Is there more to you server? Does next() actually reach a handler? Can you get the expected template from outside of ๐Ÿ‡ (with curl or postman)?

artf

Try to check errors in console, probably you miss something in your CORS configuration. Try to start only with res.header('Access-Control-Allow-Origin', '*'); BTW I close this as it's not related to grapesjs itself

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#2072June 10, 2019by fmr4111 answer
0 reactions

[QUESTIONS] show rte editor

I want to ask, why when I want to display the rte editor with "editor.getSelected (). view.enableEditing ()" but there is an error "editor.getSelected (...). view.enable Edit is not a function", Thanks

artf

Actually, enableEditing method was removed and replaced with onActive, but to avoid any future change I'd recommend using this editor.getSelected().trigger('active')

#2070June 7, 2019by adamwpe3 answers
0 reactions

[QUESTIONS] Stop the style manager from replacing AUTO with the pixel units

Not too sure how to explain it, but it appears that the style manager replaces 'AUTO' with the actual units. But if the user changes a value, e.g. margin-top. It saves the units, not the 'AUTO' value within the other fields that were not amended. Meaning the behavior of the div is unexpectedly different. e.g. no longe...

adamwpe

One of my settings was incorrect during testing.

danielwirz

Hi @adamwpe I have the exact same issue. What setting did you change to solve this? Thanks & best regards

AnnaSu

@adamwpe I have the same issue. How did you solve it?

#2067June 6, 2019by megarg3 answers
0 reactions

[QUESTIONS] cannot reference another library from a custom component

Hi Artf, I have been trying to do this for the whole day and it is not working. I could not find any example or no solution came up in my search. Here is relevant portion of my code in the "components.js" of custom plugin: I am getting a compilation error that "Formio" is not defined no-undef. Note that the script I a...

megarg

$ node -v v10.15.3 $ npx node-sass -v node-sass 4.12.0 (Wrapper) [JavaScript] libsass 3.5.4 (Sass Compiler) [C/C++] OS is: Windows 10

artf

You can't use Formio if it's not yet defined, I guess you use the code below to load it but as loading a script is an asynchrones operation you have to wait it, so the script.onload part you've commenetd in necesssary...

megarg

Hi Artf Thanks for your response. The basic problem is that "script.onload" event does not fire on Chrome. I also tried "eventListener" but that also does not fire on chrome for script. It fires for "window" but does not fire for "script"....

#2066June 5, 2019by tsuwunrut-carecloud3 answers
2 reactions

[QUESTION] Page Limit

I'm currently using GrapesJS as a Letter/Form Composer, and it's been working wonderfully so far. However I'm just finishing up the last few requirementsI'm scaling the canvas to the size of an A4 piece of paper so that when it prints, everything is consistent with the form they've built. However, I'm unsure whether o...

bloigge

@tsuwunrut-carecloud - did you find a solution for your problem? I am facing something similar.

bharatnadkarni

@tsuwunrut-carecloud @bloigge @sagarneo11 did any of you find a solution to this?

sagarneo11

@tsuwunrut-carecloud, Can you please let us know if you find solution on above mentioned function?, would love to have same function in my app it would be really helpful if you could suggest.

#2065June 5, 2019by Amir28283 answers
0 reactions

Few Questions

First of all, Amazing project thumbs up to everybody involved. I have a couple of questions:How can I iterate over all of the components and change their content on the canvas. I would like to implement a find and replace function that will replace a specific string in all of the Elements inside the canvas. Is there a...

Amir2828

Ok I Managed to solve the 1st problem. I used get components and recursively iterated on the tree. When I finished I used the DomComponents.render() Still looking for some direction regarding the 2nd question

Amir2828

Ok I think I also managed to figure out the 2nd question. I injected to the Canvas JQuery script which made the Accordions and Sliders Behave as expected.

Amitkumar85533

Hi @Amir2828 , Can you tell me about the accordion? Can you give a small example?

#2063June 3, 2019by benvmatheson3 answers
3 reactions

[Question] Can I disable media queries?

Is it possible to disable media queries? E.g. turn this: @media (max-width: 331px){ .image-block{ position:absolute; top:0; } .c976{ width:331px; height:526px; position:absolute; } } Into this: .image-block{ position:absolute; top:0; } .c976{ width:331px; height:526px; position:absolute; }

artf

Yes, you can use this option: https://github.com/artf/grapesjs/blob/60c1755c57da02b57988fbe0e1a0321a5395728c/src/editor/config/config.js#L90-L93

benvmatheson

I could remove these programmatically, but is it possible to tell grapes not to add media queries to CSS?

benvmatheson

We're needing to allow selecting device sizes while editing, but need to remove media queries. As this is a bit of an edge case, I'm assuming I should expect media queries to always be applied if in device preview mode?