gridstack.js icon indicating copy to clipboard operation
gridstack.js copied to clipboard

Is there a reason items do not get a `gs-w/h="1"` when they are the smallest size?

Open tobias-hay opened this issue 2 years ago • 2 comments

Subject of the issue

Simple put, I was wondering if there is a reason you do not have the item retain the gs-w/h attribute when it is at a 1x1 size?

Your environment

gridstack 10.3.1, on a react 18.3.0 project

Steps to reproduce

Just scale a tile down to a 1x1

Expected behavior

The item would ideally retain the gs-w/h attribute even when it is at a width/height of 1.

tobias-hay avatar Aug 28 '24 19:08 tobias-hay

I had some people use high level of column counts, with most/all items being 1x1. I was doing some css optimization for performance reason and decided to remove the most common 1x1 attr in order to greatly reduce the DOM info. I also removed some other styles/attr that were not needed to render.

adumesny avatar Aug 28 '24 22:08 adumesny

Is it possible to still have it as an option maybe?

I wanted to use those attr to style the card depending on how much space it had. It's all good if not, I'll just figure out another way to do it.

tobias-hay avatar Aug 28 '24 23:08 tobias-hay