SlickGrid icon indicating copy to clipboard operation
SlickGrid copied to clipboard

unwanted horizontal scrollbar appearing in SlikGrid 2.3.16 (and earlier) when JQuery version > 3.1.1 and grid has border

Open DecMcLaughlin opened this issue 7 years ago • 4 comments

Hi

We're getting a horizontal scrollbar appearing when the grid has a border and JQuery version > 3.1.1. it appears JQuery made some changes around boxModelAdjustment and getWidthOrHeight functions.

In our case SlikGrid grid-canvas style width property is calculated +2px out (we have a 1px border) .

I have to confess to not being able to find where the style is appended to $canvas = $("

").appendTo($viewport); if someone could point me to where that is i may be able to figure out why. That said shouldn't the grid canvas be calculated with .width and not .css("width")?

changing viewportW = parseFloat($.css($container[0], "width", true)); to viewportW = parseFloat($container.width()); seems to fix the problem.

Appreciate any help you can provide!

DecMcLaughlin avatar Dec 16 '18 21:12 DecMcLaughlin

I think this is a good idea in principle, but dealing with width in jQuery can be a world of pain. If we're still supporting old versions of jQuery and older browsers, this may break those use cases. @ghiscoding do you have an opinion?

6pac avatar Dec 23 '18 10:12 6pac

I don't have any objection, it seems actually overkill to use $.css() on top of width. I just don't know where all of this code is now with the new version, there's 4 containers now, so there might be 4 places to change instead of 1

ghiscoding avatar Dec 23 '18 15:12 ghiscoding

@DecMcLaughlin @8over8 your PR #314 got merged, so this issue should now be fixed, right? Can we close this issue?

ghiscoding avatar Jan 12 '19 19:01 ghiscoding

Yes Indeed. Thanks for your support.

DecMcLaughlin avatar Jan 18 '19 14:01 DecMcLaughlin