angular-gridster2 icon indicating copy to clipboard operation
angular-gridster2 copied to clipboard

GridsterItem resizableHandles property overrides the whole grid instead of each item

Open mfjharvey opened this issue 2 years ago • 2 comments

Feature #821 introduced the resizableHandles property, which should allow the resize handles to be specified individually for each Gridster item, overriding any resize handle settings in the grid options for that specific item.

Unfortunately, it seems as though the grid is only looking at the resizableHandles property on the first item in the grid, and applying that item's resize handle settings to all items in the grid.

I've made a StackBlitz to demonstrate the issue.

The grid in the StackBlitz example only has two items:

  1. resizableHandles set to only s so it should have a resize handle on the bottom
  2. resizableHandles set to only e so it should have a resize handle on the right side

Instead of each item using its own resizableHandles settings, both items have resize handles on the bottom only.

If I've set this up incorrectly, please just let me know what I'm doing wrong.

Thanks to everyone involved in the project, you're doing great work!

mfjharvey avatar Aug 25 '22 10:08 mfjharvey

Running into the same issue, can confirm the grid item specific resizableHandles on the first grid item is applied to all other grid items.

mpo-dev avatar Sep 08 '22 13:09 mpo-dev

I had a bit of time to look into this today and I've created a pull request that fixes the issue.

I didn't realise at the time, but you can replicate this issue on the "items" page of the documentation. Looking at the code of that page, it's clear that the intention of the checkboxes is to override properties on the first item in the grid, but instead they override every item.

Using the spread operator {...} instead of the GridsterUtils.merge function fixes the bug.

mfjharvey avatar Oct 13 '22 13:10 mfjharvey