ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Horizontal scrollbar is always scrollable

Open wendeldw opened this issue 11 years ago • 27 comments

After upgrading to 3.0.0-RC.18.

It seems you can always scroll a small area equivalent to the width of the vertical scrollbar. There is also a double line in the top right corner. Bug is clearly visible in all demos.

Is this a bug or by design. Can it be turned off?

image

wendeldw avatar Feb 09 '15 18:02 wendeldw

Hello,

You can disable the horizontal scroll bar with enableHorizontalScrollbar option.

$scope.grid = { enableHorizontalScrollbar: 0 };

0 -> disable 1 -> enable 2 -> enable when needed

fresnault avatar Feb 09 '15 18:02 fresnault

Thanks for the response, but it doesn't fix the bug.

The scrollbar should be visible but without the extra offset.

Something has been changed between RCv12 and RCv18

wendeldw avatar Feb 09 '15 18:02 wendeldw

still when the scrollbar is disabled with 0, it doesnt show but when pressing middle mouse and scrolling right you can still reach the dead zone:

untitled

mikila85 avatar Feb 10 '15 07:02 mikila85

You can see the double lines in the area marked as green.

Regardless, I need to have the scroll-y enabled, as I did in rc12. There is an offset which appeared after version rc12.

Paul, can you comment on this?

2015-02-10 8:37 GMT+01:00 mikila85 [email protected]:

still when the scrollbar is disabled with 0, it doesnt show but when pressing middle mouse and scrolling right you can still reach the dead zone:

[image: untitled] https://cloud.githubusercontent.com/assets/3965957/6123262/728369b0-b108-11e4-9ca0-6269e7635177.png

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ng-grid/issues/2734#issuecomment-73656488.

wendeldw avatar Feb 10 '15 08:02 wendeldw

This is a duplicate of #2521

c0bra avatar Feb 11 '15 02:02 c0bra

I have the same problem :/ It exists also in RC19

mszpiler avatar Feb 13 '15 21:02 mszpiler

I found a place where is bug: https://github.com/angular-ui/ng-grid/blob/master/src/js/core/directives/ui-grid-header.js#L75

In this place the scrollbar width should be substracted from viewport width (viewport include scrollbar width), so it should be changed for something like this: var availableWidth = containerCtrl.colContainer.getViewportWidth() - grid.scrollbarWidth;

grid.scrollbarWidth is greater than 0 only when enableVerticalScrollbar is set to ALWAYS, so it should work when we have scroll enabled and disabled...

I don't know this library, so it's hard for me to say that will break something else or not - i think no, but maybe someone else confirm this or propose how do this better?

dczepierga avatar Feb 16 '15 08:02 dczepierga

Closed via cf86090

c0bra avatar Feb 16 '15 17:02 c0bra

fixed?? :)

mikila85 avatar Feb 16 '15 17:02 mikila85

yes fixed :)

dczepierga avatar Feb 16 '15 17:02 dczepierga

thank you :+1: great work!! going to try now.

mikila85 avatar Feb 16 '15 17:02 mikila85

@c0bra 3.0.0-rc.19-e099c5b can still drag it with mouse. Without header: image with header: image

mikila85 avatar Feb 16 '15 17:02 mikila85

@mikila85, but the version e099c5b5721afcae40d1ad3cc2c8b4e5bde00731 is before this fix?

Look here: https://github.com/angular-ui/ng-grid/commits/master

You should have at least cf86090f66ee057f541961d563ca42597112bdb4

dczepierga avatar Feb 16 '15 18:02 dczepierga

thank you, sorry, still new at this i'll learn, thank you again :)

mikila85 avatar Feb 16 '15 18:02 mikila85

I checked it. It is almost perfect, but when enableHorizontalScrollbar = 2 scrollbar shouldn't be visible but it is visible.

mszpiler avatar Feb 16 '15 23:02 mszpiler

OK thanks for checking that. I'll try again tomorrow :)

c0bra avatar Feb 17 '15 00:02 c0bra

@mszpiler, scroll is always visible because options enableHorizontalScrollbar = 2 is not supported? :)

Look here for available values for scrollbar: https://github.com/angular-ui/ng-grid/blob/master/src/js/core/constants.js#L104

And here for relese notes: https://github.com/angular-ui/ng-grid/blob/master/CHANGELOG.md

scrollbars.WHEN_NEEDED no longer an option

So it not works because this option is not supported ;)

dczepierga avatar Feb 17 '15 06:02 dczepierga

@mszpiler how did you get the version that includes the fix? all i find here: https://github.com/angular-ui/ui-grid.info/tree/gh-pages/release is * ui-grid - v3.0.0-rc.19-78a4b43 - 2015-02-16 and i dont see the fix is there, is there a way to get the most recent .js without waiting for an official RC to be released?

mikila85 avatar Feb 17 '15 07:02 mikila85

@mikila85 I build it with changes @c0bra on master @dczepierga thank you for detailed explanation - so solution for me is ok :)

mszpiler avatar Feb 17 '15 07:02 mszpiler

how did you build it? (sorry for noob question)

mikila85 avatar Feb 17 '15 07:02 mikila85