Skip to content

Conversation

fabiot21
Copy link
Contributor

@fabiot21 fabiot21 commented Jul 24, 2023

Changed current collision prop to be compatible with new api (#27 #35 #23)

Also (since we are still pre 1.0) this PR optimizes collision handling by merging the compress and collision props into a single collision prop.

The refactored collision prop provides three behaviors:

  • none (default): Grid items collisions are ignored. Current collision={false} compress={false}
  • push: On collision, items move to the first available space. Current collision={true} compress={false}
  • compress: On collision, items compress vertically towards available space. Current collision={true} compress={true}

This enhancement simplifies the API, improves intuitiveness, and also makes the API more extensible, allowing for future collision behaviors to be added without major structural changes.

@fabiot21 fabiot21 mentioned this pull request Jul 24, 2023
10 tasks
@cuire cuire merged commit 14e8290 into cuire:refactoring Jul 24, 2023
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

Successfully merging this pull request may close these issues.

2 participants