glide-data-grid icon indicating copy to clipboard operation
glide-data-grid copied to clipboard

Add option to draw extra cells for paddingBottom/paddingRight

Open pzcfg opened this issue 4 years ago • 4 comments

Right now paddingBottom and paddingRight doesn't draw anything in the "padded" region

https://user-images.githubusercontent.com/94077014/152489535-43094683-ced4-4ce5-b676-4d7d9249172e.mp4

but in my case I'd like the empty cell lines to still be drawn in these areas.

https://user-images.githubusercontent.com/94077014/152489554-a5bee1ec-d03a-4d85-aebb-e6a67c5fcf8b.mp4

Terminology-wise, I think the first case would make more sense as marginBottom and marginRight, and paddingBottom and paddingRight would include the drawn lines. Alternatively maybe there could be some other boolean (or booleans) to control if/which of these areas are drawn in.

https://github.com/glideapps/glide-data-grid/blob/0916a62916d0e5a1ee3e5ae091d0567b1e1a34d8/packages/core/src/scrolling-data-grid/infinite-scroller.tsx#L116-L121

-            width: el.clientWidth - paddingRight,
-            height: el.clientHeight - paddingBottom,
+            width: el.clientWidth,
+            height: el.clientHeight,

pzcfg avatar Feb 04 '22 07:02 pzcfg

I too, like the idea!! Do you plan on or already have a PR open for the suggested addition?

bryhasagithub avatar Feb 04 '22 17:02 bryhasagithub

I can make one, but it'd be good to settle on terminology/approach first

pzcfg avatar Feb 04 '22 17:02 pzcfg

I went ahead and put up a proposal for this in #160

https://user-images.githubusercontent.com/94077014/152608583-6ab100f6-9a4a-4784-b3ba-800316b5f711.mp4

pzcfg avatar Feb 04 '22 21:02 pzcfg

Thanks for the PR @pzcfg!

We figured that the behavior you want could be achieved without breaking changes.

Here's the PR with the relevant change. https://github.com/glideapps/glide-data-grid/pull/164

ivoelbert avatar Feb 10 '22 18:02 ivoelbert