Issue #2305Opened October 2, 2019by rajasubburaj1 reactions
Wrap and UnWrap function is not working in Grapesjs selected element
Question
Code SnippetTEXT
if(data.component.get('tagName') === 'img') {
const selectedComponent = editor.getSelected();
const href = this.getHref();
const childHtml =`<a href="${href}"></a>`
$(`img#${selectedComponent.ccid}`).wrap(childHtml);
data.component.view.render();
editor.Modal.close();
}Answers (1)
pouyamiralayi• October 2, 20191 reactions
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2922
[QUESTION]: Get all css without specific component and it's children
Hi, so, in this issue #2861 we can get all the css of a selected element and it's children with: But if I want to get all the css but witho...
3 answersUpdated July 29, 2020
Issue #2308
Image is not resizing after creating a link for image
1 answersUpdated October 6, 2019
Issue #3461
Re-render trait on selected component
I know there is a function that can rerender the view of a trait. However, I still don't know how and where to use it.
0 answersUpdated May 22, 2021
Issue #3363
BUG: Set content function empties the component content
I am trying to use the set function to change the content of a component, but actually the result is an empty component with nothing inside...
1 answersUpdated March 24, 2021
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.