Issue #2656πŸ’¬ AnsweredOpened March 16, 2020by abozhinov1 reactions

Wrong position of toolbar when duplicate children component

Quick answerby abozhinov❀ 1

When overwrite these two methods in 'select-comp' command everything works perfectly. The problem was that "el" doesn't exist in the DOM. ` onHovered(em, component) { let result = {}; if (component) { const { view } = component; const { el } = view; const pos = this.getElementPos(el); result = { el, pos, component, vi...

Read full answer below ↓

Question

Hi, you can check this example: https://codepen.io/abozhinov/pen/XWbqjEJ Steps to reproduce the problem:If components existing delete them all.Drag a new carousel block. Select the first children's container.Click on the DUPLICATE icon to create a new component.After that try to select the newest component and then select the first component again. The position of the toolbar is wrong because the browser can't get the width and height of the element. [Error] TypeError: null is not an object (evaluating 'this.canvas.getHighlighter(t).style') showHighlighter (grapes.min.js:2:263826) updateTools...

Answers (3)

abozhinovβ€’ April 7, 2020

When overwrite these two methods in 'select-comp' command everything works perfectly. The problem was that "el" doesn't exist in the DOM. ` onHovered(em, component) { let result = {}; if (component) { const { view } = component; const { el } = view; const pos = this.getElementPos(el); result = { el...

abozhinovβ€’ March 16, 2020

The same result you can get when trigger render instead of reset.

abozhinovβ€’ March 16, 2020

@artf if you try on the demo is the same. Just drag the carousel and click on the slide. <img width="1440" alt="Screenshot 2020-03-16 at 14 58 23" src="https://user-images.githubusercontent.com/1404839/76760669-b8b75780-6796-11ea-8e24-8946e27949f9.png">

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.