Fix and refactor Sorter.ts
Question
- Fix the Sorter usage in StyleManager (regression with sorting property layers)
- Refactor Sorter with the usage of
Components.canMove - Update
canMovewith the check of dropping main Symbol inside its own instance.
Answers (3)
This's done.
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 or Layers, make the Sorter class work with a more generic, ab...
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 components (Symbols). Fix Sorter usage in StyleManager (regre...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4897
component:styleUpdate / component:styleUpdate:propertyName not fired
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Edge 109.0.1518.70 Reproducible demo link...
Issue #4601
update() of custom types added to StyleManager is no more triggered when switching between some targets.
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chromium 104 Reproducible demo link https:...
Issue #3137
When I select an particular element I'm not getting its styles. This issue happens only with some elements.
Not getting styles of the selected element Here is my code, const model = editor.StyleManager.getModelToStyle(component); let styleObject =...
Issue #6659
Symbol styles not synced
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Firefox 145.0 (64-bit) Reproducible demo l...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.