6pac / SlickGrid

A lightning fast JavaScript grid/spreadsheet
https://github.com/6pac/SlickGrid/wiki
MIT License
1.82k stars 422 forks source link

Resizer: bottomPadding of 0 value ignored #504

Closed xavier-90 closed 4 years ago

xavier-90 commented 4 years ago

If setting the resizer bottom padding to 0 then the grid is rendered with a bottom padding of 20px (the default). A work-around is to set the value to '0', e.g.

resizer = new Slick.Plugins.Resizer({
        container: '#gridContainer',
        rightPadding: 0,
        bottomPadding: '0',
        minHeight: 150,
        minWidth: 250
      });
ghiscoding commented 4 years ago

Ahh no it's probably because it's set as options.bottomPadding || 20, it should be changed to something like:

options.bottomPadding !== undefined ? options.bottomPadding : 20;

I didn't check at the code yet (I'll check later), but I think that is how I wrote it earlier.

So if you do a bottomPadding: 1, you'll probably be ok.

xavier-90 commented 4 years ago

Using '0' instead of 0 works for me. Using SlickGrid version 2.4.22 I created a few tests as part of my investigation, one of them using the bootstrap 4 grid system layout with preheader & resizer plugin (here if you are interested).

ghiscoding commented 4 years ago

I'm the one who created the Resizer Service and I have 3 different libs with Bootstrap (Angular-Slickgrid, Aurelia-Slickgrid, Slickgrid-Universal) with few hundred users, these libs are using this resizer service directly or a variation of it. The reason why this issue was never caught is most probably because no one ever goes with a 0 padding, I certainly don't want my grid to touch the bottom of my browser viewport, that is why I added the bottomPadding option in the first place. Anyway, I'll take a look and fix it later.

xavier-90 commented 4 years ago

I tend to use Bootstrap to manage layout behaviours, padding and margins hence the discovery I guess... I have got a solution so can move forward. BTW thanks for continuing to maintain and evolve SlickGrid, great product!