{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/6474","repository_url":"https://api.github.com/repos/angular-ui/ui-grid","labels_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/6474/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/6474/comments","events_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/6474/events","html_url":"https://github.com/angular-ui/ui-grid/issues/6474","id":275700788,"number":6474,"title":"Incorrect percentage in scroll events when scroll bar enabled but not shown","user":{"login":"cwalther","id":234094,"avatar_url":"https://avatars1.githubusercontent.com/u/234094?v=4","gravatar_id":"","url":"https://api.github.com/users/cwalther","html_url":"https://github.com/cwalther","followers_url":"https://api.github.com/users/cwalther/followers","following_url":"https://api.github.com/users/cwalther/following{/other_user}","gists_url":"https://api.github.com/users/cwalther/gists{/gist_id}","starred_url":"https://api.github.com/users/cwalther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwalther/subscriptions","organizations_url":"https://api.github.com/users/cwalther/orgs","repos_url":"https://api.github.com/users/cwalther/repos","events_url":"https://api.github.com/users/cwalther/events{/privacy}","received_events_url":"https://api.github.com/users/cwalther/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-11-21T12:51:55Z","updated_at":"2018-03-07T14:28:14Z","closed_at":"2018-01-16T05:19:47Z","author_association":"NONE","body":"When a grid (v4.0.11) has enableHorizontalScrollbar and enableVerticalScrollbar set to uiGridConstants.scrollbars.ALWAYS (default) and its content is high enough to require scrolling but not wide enough, so that no horizontal scroll bar is actually shown, then the scrolling percentage reported in vertical scroll events is incorrectly scaled.\r\n\r\nhttp://plnkr.co/edit/ovNv8v1ibKX1KwKeIait?p=preview\r\nSteps to reproduce: open console, scroll the grid all the way to the bottom\r\nExpected result: output \"percentage 1\"\r\nActual result: output \"percentage 0.9954257565095004\"\r\n\r\nThe reason seems to be that [GridRenderContainer.getVerticalScrollLength()](https://github.com/angular-ui/ui-grid/blob/a77a7470346ce18774214862a31834fd3f0de4f5/src/js/core/factories/GridRenderContainer.js#L302) unconditionally takes into account the height of the horizontal scroll bar, whether or not it is actually there.\r\n\r\nI am not sure how this would best be fixed. Comparing clientHeight and offsetHeight of the ui-grid-viewport seems like it would work to detect a space-occupying horizontal scroll bar, however the involved controller objects don’t seem to have direct access to the DOM elements to do that. (Note that the criterion is whether the scroll bar occupies space, not whether it is shown – it could also be overlaid on the content (system setting on macOS).)\r\n\r\nThe reduced scroll percentage output breaks detection of whether the grid is scrolled all the way to the bottom in the [ui-grid-auto-scroll](https://github.com/stevezau/ui-grid-auto-scroll) plugin.\r\n\r\nBy the way, I am a bit confused about the meaning of uiGridConstants.scrollbars.ALWAYS. From the name and from its documentation I would expect that it causes the scrollbar to be present all the time, whether or not the content requires scrolling (like overflow: scroll). What it actually does however is to make the scrollbar appear and disappear based on whether it is needed (overflow: auto), which is actually the more useful behavior. Is this the intention?"},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/comments/371155021","html_url":"https://github.com/angular-ui/ui-grid/issues/6474#issuecomment-371155021","issue_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/6474","id":371155021,"user":{"login":"httpete","id":1200635,"avatar_url":"https://avatars2.githubusercontent.com/u/1200635?v=4","gravatar_id":"","url":"https://api.github.com/users/httpete","html_url":"https://github.com/httpete","followers_url":"https://api.github.com/users/httpete/followers","following_url":"https://api.github.com/users/httpete/following{/other_user}","gists_url":"https://api.github.com/users/httpete/gists{/gist_id}","starred_url":"https://api.github.com/users/httpete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/httpete/subscriptions","organizations_url":"https://api.github.com/users/httpete/orgs","repos_url":"https://api.github.com/users/httpete/repos","events_url":"https://api.github.com/users/httpete/events{/privacy}","received_events_url":"https://api.github.com/users/httpete/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T14:28:14Z","updated_at":"2018-03-07T14:28:14Z","author_association":"NONE","body":"still have the problem."}}
{"actor":{"display_login":"httpete"}}