8000 Improve vertical collision item swapping by michaelnesen · Pull Request #2070 · react-grid-layout/react-grid-layout · GitHub
[go: up one dir, main page]

Skip to content

Conversation

michaelnesen
Copy link

Description

This PR aims to improve vertical collision item swapping by making items swap in the layout once it's position in the layout is past the midpoint of the colliding item. As mentioned in #2053, when dragging smaller layout items over larger ones, the smaller item needs be way past the midpoint of the bigger element for them to actually swap (See video below)

rgl-collision-detection-movement.mp4

This creates an undesired / inconsistent experience when trying to swap to elements in the layout vertically.

In this PR I adjusted the collision movement logic to swap the elements once the colliding element is halfway past the midpoint of the other layout item. Collision movement after these changes:

rgl-vertical-collision-movement-impovement.mp4

This PR [adds/removes/fixes/replaces] the [feature/bug/etc].

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Fixes #2053

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 examples
  • 🙅 no documentation needed

@github-actions github-actions bot added the core use this label for changes in `lib` directory label Sep 6, 2024
@ladderschool
Copy link

Any progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core use this label for changes in `lib` directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug with moving items breakpoints
2 participants
0