Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When columns are thin and column spacing is set, items move from their grid position when clicked #2014

Open
natle01 opened this issue Jan 29, 2024 · 3 comments

Comments

@natle01
Copy link

natle01 commented Jan 29, 2024

Describe the bug

When a responsive layout has thin columns which are less than ~6% of the layout width, clicking on a layout item it will move it left (x position).

  • margin column must be set.
  • Thin columns can be created using any mixture of these properties containerPadding, margin, width, and cols.

Your Example Website or App

https://codesandbox.io/p/sandbox/quirky-artem-tmpkws

Steps to Reproduce the Bug or Issue

  1. Set width: 800 pixels.
  2. Set cols: {{ <yourbreakpoint>: 10 }}
    Currently columns are 80px wide (10% of the layout width)
  3. Set margin: [40,0]
    Currently columns are 44px wide (5.5% of the layout width)

(Note. margin must be set)

Expected behavior

When a responsive layout item is clicked, it should not move.
Layout item should only move when it is dragged to another x or y position.

react-grid-layout library version

1.4.3

Operating System Version

Windows 11

Browser

Edge

Additional context

Similar to this bug #1924 When containerPadding is 0 and cols is large enough, clicking on the event will trigger onLayoutChange, causing the layout to move left

Screenshots or Videos

MovingLayoutItem

@AndreiAyar
Copy link

Same here. Any solution ?

@xuanxiaoxiao
Copy link

xuanxiaoxiao commented Feb 7, 2024

me too

@shamilium
Copy link

I have same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants