Issue #2647πŸ’¬ AnsweredOpened Mar 13, 2020by jcamejo3 reactions

Drag placeholder does not calculate the correct width.

Quick answerby artf❀ 1

To be honest, I'd leave getElRect as it is, using getComputedStyle in this context would be too much expensive and the function itself is a generic one (so it doesn't make sense having there stuff like boundingRect.width = boundingRect.width - margin.left - margin.right). I'm quite sure the issue is in the Sorter and...

Read full answer below ↓

Question

HI @artf, I hope you are having a nice day. There's a small issue with the drag placeholder when a block is being dragged into a possible container with lateral margins, It could happen also with top/bottom margins or padding but I'm not 100% sure. <img width="1107" alt="image" src="https://user-images.githubusercontent.com/1976679/76625994-9e803e00-6538-11ea-900e-fbbe3769cabe.png"> The reason for this being the function getBoundingClientRect that calculates the dimensions of a container, behaves irregularly in some cases, returning the width of the element without taking into account some pr...

Answers (3)

artfβ€’ Mar 19, 2020

To be honest, I'd leave getElRect as it is, using getComputedStyle in this context would be too much expensive and the function itself is a generic one (so it doesn't make sense having there stuff like boundingRect.width = boundingRect.width - margin.left - margin.right). I'm quite sure the issue i...

jcamejoβ€’ Mar 24, 2020

I got to getElRect by reading through the getDim function but i will do the research there again to look for another solution.

Thanks!

bgrand-chβ€’ May 11, 2021

Hello, For future questions or technical issues, which aren't bugs, GitHub's Discussions tab is the place to be. Don't forget to close this issue if it is resolved or write a new detailed message in Discussions -> Q&A category (and close this issue). Thank you for your understanding.

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.