cuire / svelte-grid-extended

A draggable and resizable grid layout, for Svelte
https://svelte-grid-extended.vercel.app
MIT License
74 stars 8 forks source link

[Bug] Extra space on right end of grid when grid cols differs from grid gap #81

Closed gitryder closed 2 months ago

gitryder commented 2 months ago

There is a bug in the library where specifying a grid cols value different from the grid gap value results in extra space on the right end of the grid. Specifically, this extra space equals the specified grid cols value.

Library Version: 1.2.0 Reproducible Sandbox: Repl

Steps to Reproduce:

  1. Set the cols prop on the Grid to a value different from the default Grid gap value (10).
  2. Observe the right-hand side of the grid horizontally. The grid items do not occupy all the space. If the grid gap is set to 10, the right-hand padding of the grid will not be 10px but rather the value of the cols in px.

Expected Behavior:

The grid items should occupy the entire grid space evenly, with the right-hand padding matching the specified Grid gap value.

Actual Behavior:

The right-hand padding of the grid equals the specified grid cols value instead of the grid gap value, resulting in extra space.

Examples:

Cols: 10 | Gap: 10

Screenshot 2024-05-31 at 00 12 05

Cols: 14 | Gap: 10

Screenshot 2024-05-31 at 00 14 00

Cols: 24 | Gap: 10

Screenshot 2024-05-31 at 00 13 01