Enhance "draggable" attribute of components in order to allow excluding certain components when wildcard "*" is set for draggable components
Question
Hi. I wish to enhance "draggable" attribute of components in order to allow excluding certain components when wildcard "*" is set for draggable components. For example, according to my case:
I need the "video" and "image" component to be draggable on every component, except the "my_custom_component". My suggestion is to add a new attribute "draggable_excluding" or to enable two fields in "draggable" attribute as an object:
draggable: { components: c, //c typeof string or array exclude: e //e typeof string or array }
Thanks in advance.
Answers (3)
You mean something like draggable: "*:not(your-component)"?
Yes, I liked your thinking!
Inside draggable and droppable properties you can pass any CSS-like query string so it's already possible
Related Questions and Answers
Continue research with similar issue discussions.
Issue #490
Prevent modifying specific image components
I have a use case where I would like to make some specific components completely locked down (i.e. not resizable, not draggable, not copyab...
Issue #873
[Need help]: After using urlLoad from storage manager impossible to change component with Traits
Hello, I am save template to db and after loading from db impossible to change component with Traits. Video example on countdown: https://y...
Issue #1095
[FEATURE REQUEST] Preselect a trait select option
Hello, I'd like you to add to the options array of a select trait a third parameter next to 'name' and 'value', which is 'selected' in orde...
Issue #713
Restrict Droppable Components to specific Component Types
So the wording of this may seem confusing, but essentially I'm trying to use gjs-droppable="" the same way one would use gjs-draggable=""....
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 →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.