How to avoid adding a wrapper div/tagName? When dropping a custom component in the canvas. #4542
Unanswered
FaisalShaikhHA
asked this question in
Q&A
Replies: 1 comment 3 replies
-
When you define a new custom component you should describe the component itself by using properties like // No need to use defaultModel.extend, or adding `data-gjs-type` attribute
domc.addType('slider', {
model: {
defaults: {
tagName: 'slider-element'
}
},
}); |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have created a custom component slider and added data-gjs-type="slider" to the root element but when I drop it on the canvas there are two slider components visible on the layers manager.
I know that this is because I have added data-gjs-type="slider" on my component's root element, grapesjs adds one wrapper element with the same attribute, and hence two slider components are visible.
But I want to avoid that wrapper element because it hides behind the component root element and then it is undetectable unless we navigate to layer manager. Please let me know how can I achieve this. Thank you
Screenshot: https://d.pr/i/yYpZKn
Beta Was this translation helpful? Give feedback.
All reactions