Child component not selectable when using custom view
If you add elements via View you can't select them, only Models can be selectable Read this page https://grapesjs.com/docs/modules/Components.html you also create new types without isComponent
Read full answer below ↓Question
I'm trying to create a custom component that creates it's own view with nested HTML. I do not want this HTML to be rendered as a component so I use (using jQuery) view: defaultType.view.extend({ init: function () { $(this.el).html('<div class="container"></div>'); }, getChildrenSelector: function () { return '.container'; }, }) But, if I add child components, they are not selectable through the editor. They can only be selected through the Layer panel. I've created a jsFiddle of the issue: https://jsfiddle.net/pscott/72xgqkdy/ I've found that if I remove the 'pointer-events' style from the pa...
Answers (3)
If you add elements via View you can't select them, only Models can be selectable
Read this page https://grapesjs.com/docs/modules/Components.html you also create new types without isComponent
@artf I understand how to use isComponent. I will be using fromElement: false so it's not required for how I intend to use grapes. I do not want the elements added to the view to be selected, I do however want nested components to be selectable. Currently they are not. For example, if I render this...
Ok, now I got it. The getChildrenContainer should work as you expect, I'll just try to remove those pointer-events stuff and make the hover work more like the select. BTW you don't need jquery, grapesjs under the hood uses cash (which has jquery-like API) so you can do: this.$el.html('...'); There...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #673
how to render block manager outside container?
I'm new to this great library and it seems very neat and clean BUT here is the problem that I have. I'm having gjs rendered in the middle,...
Issue #1409
Component Drag Event
I want to know how can I get that component from which element is dragged and drop to the other component. I need to add a class if compone...
Issue #660
Select Parent Function not working when parent element is not selectable
Hi @artf, I have a question about select parent function. Cannot select the parent when parent element is not selectable, suggest to skip t...
Issue #461
RTE toolbar appears in the top panel
Hi, We recently updated GrapesJS from 0.8.8 to 0.12.15. After the upgrade, I found that the rte-toolbar appears in the top panel for some r...
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.
Tutorial
Super Tooltip for GrapesJS — Version 0.1.5 Released 🎉
We’re excited to announce the v 0.1.5 update of Super Tooltip, our floating‑menu and tooltip plugin for GrapesJS
Tutorial
GrapesJS in 2026: The Complete Guide to the Open-Source Web Builder Framework
Master GrapesJS in 2026. Architecture, code examples, React integration, plugin development, Studio SDK, and how it compares to other projects
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.