GrapesJS Issues

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

466 issues found

πŸ” components
#3225Jan 9, 2021by Abhisheknanda13444632 answers
0 reactions

How to Update Style from checkbox Trait?

Hi @artf I am trying to update the style using the checkbox trait but it's not calling the function. Here is the code I really appreciate any insight that you can provide! Thanks

Abhisheknanda1344463

@artf Got it silly-Mistake move the init function in the model itself. Closing the issue

GJSBlock

Thanks for reporting this, @Abhisheknanda1344463. Great question about How to Update Style from checkbox Trait?. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for yo...

#3224Jan 8, 2021by marcepoblet3 answers
1 reactions

ChangesCount is not incremented, when changes are applied in any Text component

https://user-images.githubusercontent.com/64096863/104047608-af352b00-51c0-11eb-8261-1d7ae9277d25.mp4 The parameter "changesCount" is not incremented when you double click in any text component and write or changes are made inside of any text component. For button/images components, the parameter "changesCount" is inc...

artf

Thanks @marcepoblet the fix is ready for the next release

marcepoblet

Thanks @marcepoblet the fix is ready for the next release Thanks! @artf , do you have some estimation for the release date?

GJSBlock

Thanks for reporting this, @marcepoblet. The issue with changesCount is not incremented, when changes are applied in any Text component appears to be a race condition or state management timing problem. This typically happens when componen...

#3223Jan 7, 2021by ianef3 answers
2 reactions

Create the canvas from a URL

I've been playing with GrapesJS and trying to integrate it into a Symfony 5 project. In particular I want to be able to edit templates in the editor based on Bootstrap 4 and other components like FontAwesome Pro and custom blocks based on these. I use Symfony's Webpack-Encore bundle to generate the scripts and style f...

ianef

That's a real shame. I didn't say anything about fetching from another site, what I wanted to do was keep it consistent with the rest of the project. Oh well, I'll keep looking elsewhere for an editor that integrates better with the curren...

artf

Hi Ian, if you need to load HTML content from a URL I can only suggest fetching it server-side and initialize the editor with that content (loading external resources in the browser would mostly hit the cross-origin issue), so, for how bro...

GJSBlock

Thanks for reporting this, @ianef. Great suggestion about FEAT: Create the canvas from a URL! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior. Using the event system: Alternative ap...

#3222Jan 7, 2021by bgrand-ch3 answers
0 reactions

How to refresh/re-render after new node added?

I manually add a new node into a rendered component. The visual result is OK, but impossible to save, because my style isn't with the auto-generated GrapesJS ID. To manually resolve this poblem, I double-click on the component to enter to it and I click outside in the canvas body. Then, the GrapesJS ID and data-gjs-ty...

bgrand-ch

Optimized TextEditor.vue file: But the problem persist:βœ”οΈ span node replaces the previous content of selection, with font-family and color styles.❌ span node isn't recognized by GrapesJS, because there isn't GrapesJS auto-generated styles...

bgrand-ch

ℹ️ Don't works directly with HTML, works only with JSON. Component = JSON node (html element + GrapesJS data) Sources:https://grapesjs.com/docs/modules/Components.htmlhttps://grapesjs.com/docs/api/component.html

GJSBlock

Thanks for reporting this, @bgrand-ch. Great question about How to refresh/re-render after new node added?. The recommended approach with ProseMirror is to use the event-driven API. Start here: Check the GrapesJS documentation for your spe...

#3219Jan 6, 2021by Abhisheknanda13444632 answers
0 reactions

Add Type for block and css with class name

Hi @artf I am stuck on one thing I want to add one block in which I want to add style with the class name also Here is my code -: This give me the exact thing what I wanted like HTML-code in the HTML section and style part in the style section but I want to add a new trait for the same and how can I define type in thi...

artf

and make yourself a favor, stop defining entire sections in blocks, use a component-oriented approach so your blocks will be mainly like this:

GJSBlock

Thanks for reporting this, @Abhisheknanda1344463. Thanks for sharing your report about Add Type for block and css with class name. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbo...

#3213Dec 30, 2020by theSC0RP4 answers
5 reactions

How to save the dynamically added traits

Hi, @artf, I have a custom component that has a button trait. When the button is pressed, I am adding a custom trait dynamically using comp.addTrait(). When I load the saved template, I want the container to show the dynamically added traits too. (I am loading the template using components but the dynamically added tr...

artf

I made it work by having a count attribute on the component and then adding the trait count times in the init of the container. This is the correct way. Traits are intentionally skipped from the JSON, otherwise, you'd put on hold your comp...

theSC0RP

@artf, thanks for replying. That was a really valuable piece of information.

theSC0RP

I made it work by having a count attribute on the component and then adding the trait count times in the init of the container.

#3212Dec 30, 2020by Abhisheknanda13444632 answers
0 reactions

Lightbox Component

Hi @artf I am trying to make a component lightbox as the same as the grape drop. I am not able to update the src of the image Could you please help me with that This is the code that I've written so far Lightbox block Component- :

artf

Check the image component

GJSBlock

Thanks for reporting this, @Abhisheknanda1344463. Great question about Lightbox Component. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Loo...

#3211Dec 29, 2020by alemenciones2 answers
3 reactions

How to move components

Hello dear: I want move a component to first/end in the wrapper programmatically, i think something like editor.getWrapper().add(editor.selectedComponent(), {at: 0});, but this's adding a new clone from selectedComponent, maybe with trigger "sorter:drag:end" at position?? can you help me? sorry for my poor english :')

artf

Probably it makes sense to add a new component.move(desComponent, opts) method to cover such a case, but for now you can achieve it in this way:

GJSBlock

Thanks for reporting this, @alemenciones. Great question about how to move components. The recommended approach with ProseMirror is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for...

#3209Dec 24, 2020by TouficNouwayhedd2 answers
1 reactions

When in preview mode, the toolbar is only being hidden but still clickable

Version: 0.16.22 Are you able to reproduce the bug from the demo? Yes What is the expected behavior? When the use presses the preview button, the icon toolbar must no be clickable. Describe the bug detailed When the user presses preview (even in the demo website), if you hover over the selected component before pressi...

artf

Fix ready for the next release

GJSBlock

Thanks for reporting this, @TouficNouwayhedd. The issue with When in preview mode, the toolbar is only being hidden but still clickable appears to be a race condition or state management timing problem. This typically happens when componen...

#3207Dec 23, 2020by shkhalid4 answers
1 reactions

Form is not submitting

I am trying to create as custom block. But the form is not submitting when i use components inside content. I am able to get all the form data when i use content instead of component. But then it's not allowing me drag new inputs to form.

gixid192

The important part - the html is missing. If you can, you should share the code in codesandbox or similar online editors.

artf

Yeah, we need the complete code to understand the issue. Anyway, if you're using script please define a Custom Component instead of placing it directly in the Block, or you'll face issues on storing. I know that this is how is illustrated...

no-response[bot]

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take ac...

Browse all topics