#6835·grapesjs

BUG: Resizing an absolutely positioned element with a CSS transform causes it to jump

Author: hosseinghzadehCreated Sep 25, 2026Updated Sep 25, 2026

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Google Chrome: Version 153.0.8010.53 (Official Build) (arm64)

Reproducible demo link

https://jsfiddle.net/o36r8umc/

Describe the bug

How to reproduce the bug?

  1. Open the provided JSFiddle.
  2. Click Run if the preview is not already running.
  3. The affected element is selected automatically.
  4. Drag the left-center or right-center resize handle horizontally.
  5. Observe that the element jumps significantly from its original position.

What is the expected behavior?

The element should resize from the selected handle without unexpectedly changing its visual position.

For example, when dragging the left-center handle to the left, the left edge should follow the pointer while the opposite edge remains anchored.

What is the current behavior?

When an absolutely positioned component has a positional CSS transform such as transform: translateX(-50%), resizing it causes the component to jump.

GrapesJS appears to read the element's already-transformed visual coordinates, write those coordinates into left/top, and then preserve the existing transform. The transform is therefore applied again to the newly written position.

For example, before resizing:

  • left: 450px
  • width: 420px
  • transform: translateX(-50%)
  • Visual left position: approximately 240px

After dragging the left resize handle by approximately 50px:

  • left becomes approximately 190px
  • width becomes approximately 470px
  • The transform is preserved
  • Visual left position becomes approximately -45px

The exact numbers depend on the drag distance, but the unexpected jump is consistent.

This is reproducible with GrapesJS 0.23.6 in a standalone example without any application-specific integration code.

The initial styles of the affected element are:

css
position: absolute;
left: 450px;
top: 150px;
width: 420px;
height: 60px;
transform: translateX(-50%);

It appears that the resizer obtains the starting position from a transformed getBoundingClientRect() value and later writes that visual position into the component's CSS left/top properties while preserving the transform.

Relevant source files:

Code of Conduct

  • I agree to follow this project's Code of Conduct