GrapesJS Issues

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

3,464 issues found

#6180Sep 30, 2024by padcom4 answers
1 reactions

Trait's `setValue()` method not called when value changes

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome latest Reproducible demo link https://codesandbox.io/p/sandbox/withered-rgb-xmw8gk Describe the bug How to reproduce the bug?Open code sandboxSelect "body" (type: 'wrapper') - observe alert about getting value from...

padcom

Thank you! I verified and it is working as expected!

padcom

From what I can see the Trait.setValue() is not called when the value comes from an input. Instead the setTargetValue() is called which doesn't check if the setValue() method of the trait definition is there. Also, the Trait.setValue() che...

padcom

I tried following this discussion to get it working but as you can see in the sandbox it just doesn't work.

#6172Sep 25, 2024by yashvi20262 answers
0 reactions

Need dark theme support in editor

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link --- Describe the bug It would be great if you add theme switching in the editor, allowing me to toggle between dark and light themes based on my preference.Code of Conduct [X] I agree to follo...

artf

Please use the discussions instead of bug issues

GJS Helper

GrapesJS does not come with a built-in dark/light theme switcher, as its UI is highly customizable via CSS. However, you can easily implement dark theme support by leveraging GrapesJS's extensive use of CSS variables and by toggling a cust...

#6171Sep 24, 2024by rhoenerSBS2 answers
0 reactions

Track custom storable with UndoManager

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v129 Reproducible demo link not applicable Describe the bug HI @artf, I am currently implementing an editor with grapesjs in which it is possible to add chapters alongside the already existing pages. I implemented a...

artf

Hey @rhoenerSBS please avoid opening bug issues for questions.

GJS Helper

The GrapesJS UndoManager primarily tracks changes to the editor's core models (components, styles, pages, assets) by listening to specific events, notably change:state. To make it track changes to your custom ChapterStorage module, which i...

#6152Sep 18, 2024by stpp24 answers
1 reactions

CSS added via custom code persists after custom code component is removed

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? any Reproducible demo link https://grapesjs.com/demo Describe the bug How to reproduce the bug?Add custom code component with HTML + CSSDelete custom code component. What is the expected behavior? All code should be remove...

artf

This is not related to the core and should be addressed at the plugin level. Please create the issue there and we'll try to figure out the right approach.

mosh-tudor

@stpp2 This is not really a bug; it's more of a feature. :) Try using clearStyles: https://github.com/GrapesJS/grapesjs/blob/d48e1e34a9fa363dcb83fdcca53a89563db17063/packages/core/src/editor/config/config.ts#L260-L272

stpp2

Yeah clearStyles is already enabled in my case, but that doesn't seem to work well in many cases. Either way I'd expect the Custom Code component to be somewhat "containerized" so it's not leaving anything in the doc when removed.

#6143Sep 10, 2024by rhoenerSBS2 answers
0 reactions

BUG/[QUESTION]: How to correctly wrap a Component on add/mount?

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v128 Reproducible demo link https://jsfiddle.net/fjyk6n4a/2/ Describe the bug Hi @artf, I am currently trying to wrap a component in a section component if its has not been wrapped yet. I am hooking into the compone...

jasonvijayy

Hi @artf, Reproducible Link I’m also hitting a crash when using component.replaceWith() together with UndoManager. This only happens when replaceWith() is triggered during editor lifecycle events (e.g. change:status, component:selected, co...

GJS Helper

The issue you're facing with the UndoManager stack becoming inconsistent after wrapping a component using component.replaceWith inside the component:mount event is a common challenge when modifying the editor's state in a way that doesn't...

#6142Sep 10, 2024by rhoenerSBS2 answers
0 reactions

Redo of Pages not working properly

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v128 Reproducible demo link https://app.grapesjs.com/studio Describe the bug After adding a Page, removing it with undo and adding back with redo, the page is not working properly. The Layer Manager does not update...

artf

Thanks for the report @rhoenerSBS

GJS Helper

This is indeed a bug in GrapesJS's undo/redo mechanism, specifically when handling page additions and removals. The behavior you've described is consistent with an incomplete restoration of the page's internal state after a 'redo' operatio...

#6130Sep 7, 2024by juverric1 answer
0 reactions

---

---

GJS Helper

To create a custom GrapesJS component with editable text, an editable image, and custom styling options, you need to define a new component type using editor.DomComponents.addType and then register it as a block. This allows users to drag...

#6122Sep 4, 2024by mohamedsalem4013 answers
3 reactions

Fix and refactor Sorter.ts

[x] Fix the Sorter usage in StyleManager (regression with sorting property layers) [x] Refactor Sorter with the usage of Components.canMove [x] Update canMove with the check of dropping main Symbol inside its own instance.

mohamedsalem401

This's done.

mohamedsalem401

The idea is to refactor the sorter for improved maintainability and readability. We can implement the following changes:Make Sorter class depend on an abstract tree structure rather than relying on specific implementations like Component o...

GJS Helper

This fix and refactoring addresses several key areas within GrapesJS's Sorter.ts and component movement logic, resolving a regression in the Style Manager and enhancing the overall drag-and-drop experience, especially concerning reusable c...

#6116Sep 3, 2024by SamMousa4 answers
4 reactions

AsDocument not working as expected

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 128 Reproducible demo link https://jsfiddle.net/sammousa/bxgsdc12/11/ Describe the bug How to reproduce the bug?Load an HTML string with a non empty <head>, using the option {asDocument: true}.Export the data via ed...

SamMousa

Thank you, but that's not really the point. I'm fully able to make a workaround, but that does not fix the bug. The bug is that an export via getProjectData() followed by an import via loadProjectData() should result in the same state. Fur...

artf

The bug is that an export via getProjectData() followed by an import via loadProjectData() should result in the same state. Yeah definitely not expected, we'll look into it. Appreciate the easily reproducible steps on the demo πŸ‘

artf

Thanks @SamMousa detailed bug reports are always welcome. If a direction is requested, we're happy to guide you πŸ™‡β€β™‚οΈ

#6102Aug 31, 2024by Alababdiy3 answers
5 reactions

Traits Not Displayed After Reloading Editor for Custom Component

GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome 91VReproducible demo link https://jsfiddle.net/8tsj5vpb/Describe the bug I'm encountering an issue with GrapesJS where traits defined for a custom component are not being displayed after reloading the editor. The trai...

mohamedsalem401

@Alababdiy I was unable to reproduce the issue using the link provided. However, it seems like the issue is that GrapesJS doesn't allow adding or defining a component after it has been initialized.

mohamedsalem401

Hey @Alababdiy, I wasn't able to reproduce the issue you described in the JSFiddle.

GJS Helper

You've encountered a common issue related to how GrapesJS persists and re-identifies custom components after reloading the editor. The traits for your custom component disappear because GrapesJS is not correctly re-associating the loaded c...

Browse all topics