{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2512","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2512/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2512/comments","events_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2512/events","html_url":"https://github.com/angular-ui/ng-grid/issues/2512","id":53735672,"number":2512,"title":"Scrolling with the mouse wheel doesn't fully reach the top or bottom","user":{"login":"AnneLaureF","id":497836,"avatar_url":"https://avatars.githubusercontent.com/u/497836?v=3","gravatar_id":"","url":"https://api.github.com/users/AnneLaureF","html_url":"https://github.com/AnneLaureF","followers_url":"https://api.github.com/users/AnneLaureF/followers","following_url":"https://api.github.com/users/AnneLaureF/following{/other_user}","gists_url":"https://api.github.com/users/AnneLaureF/gists{/gist_id}","starred_url":"https://api.github.com/users/AnneLaureF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnneLaureF/subscriptions","organizations_url":"https://api.github.com/users/AnneLaureF/orgs","repos_url":"https://api.github.com/users/AnneLaureF/repos","events_url":"https://api.github.com/users/AnneLaureF/events{/privacy}","received_events_url":"https://api.github.com/users/AnneLaureF/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/ng-grid/labels/investigating","name":"investigating","color":"d7e102"}],"state":"open","locked":false,"assignee":{"login":"PaulL1","id":5248789,"avatar_url":"https://avatars.githubusercontent.com/u/5248789?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulL1","html_url":"https://github.com/PaulL1","followers_url":"https://api.github.com/users/PaulL1/followers","following_url":"https://api.github.com/users/PaulL1/following{/other_user}","gists_url":"https://api.github.com/users/PaulL1/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulL1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulL1/subscriptions","organizations_url":"https://api.github.com/users/PaulL1/orgs","repos_url":"https://api.github.com/users/PaulL1/repos","events_url":"https://api.github.com/users/PaulL1/events{/privacy}","received_events_url":"https://api.github.com/users/PaulL1/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular-ui/ng-grid/milestones/12","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/milestones/12/labels","id":435248,"number":12,"title":"3.0","description":"","creator":{"login":"timothyswt","id":1736223,"avatar_url":"https://avatars.githubusercontent.com/u/1736223?v=3","gravatar_id":"","url":"https://api.github.com/users/timothyswt","html_url":"https://github.com/timothyswt","followers_url":"https://api.github.com/users/timothyswt/followers","following_url":"https://api.github.com/users/timothyswt/following{/other_user}","gists_url":"https://api.github.com/users/timothyswt/gists{/gist_id}","starred_url":"https://api.github.com/users/timothyswt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothyswt/subscriptions","organizations_url":"https://api.github.com/users/timothyswt/orgs","repos_url":"https://api.github.com/users/timothyswt/repos","events_url":"https://api.github.com/users/timothyswt/events{/privacy}","received_events_url":"https://api.github.com/users/timothyswt/received_events","type":"User","site_admin":false},"open_issues":152,"closed_issues":310,"state":"open","created_at":"2013-09-24T04:48:10Z","updated_at":"2015-01-09T02:31:56Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-01-08T10:29:26Z","updated_at":"2015-01-09T07:59:55Z","closed_at":null,"body":"Scrolling with the mouse wheel doesn't fully reach the top or bottom, when the number of rows left outside of the viewport is inferior to `scrollThreshold` and the console show this error:\r\n> Uncaught TypeError: Cannot read property 'percentage' of undefined\r\n\r\nYou can see this in any tutorial page.\r\n\r\nI think this is due to line 2427 in not-minified js:\r\n```javascript\r\n// Let the parent container scroll if the grid is already at the top/bottom\r\nif (args.y.percentage !== 0 && args.y.percentage !== 1) || (args.x.percentage !== 0 && args.x.percentage !== 1)) {\r\n    evt.preventDefault();\r\n}\r\n```\r\nIn this case `args.y.percentage` is either `0` (top) or `1` (bottom) and `args.x` is undefined because `newEvent.deltaX === 0`, hence the error when checking the condition on the `if`\r\nI solved it in my local copy by adding `angular.isDefined(args.x)`:\r\n```javascript\r\n// Let the parent container scroll if the grid is already at the top/bottom\r\nif (args.y.percentage !== 0 && args.y.percentage !== 1) || (angular.isDefined(args.x) && args.x.percentage !== 0 && args.x.percentage !== 1)) {\r\n    evt.preventDefault();\r\n}\r\n```\r\n\r\nrelated issues (I think): #2491 and #2492"},"comment":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/comments/69304161","html_url":"https://github.com/angular-ui/ng-grid/issues/2512#issuecomment-69304161","issue_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/2512","id":69304161,"user":{"login":"AnneLaureF","id":497836,"avatar_url":"https://avatars.githubusercontent.com/u/497836?v=3","gravatar_id":"","url":"https://api.github.com/users/AnneLaureF","html_url":"https://github.com/AnneLaureF","followers_url":"https://api.github.com/users/AnneLaureF/followers","following_url":"https://api.github.com/users/AnneLaureF/following{/other_user}","gists_url":"https://api.github.com/users/AnneLaureF/gists{/gist_id}","starred_url":"https://api.github.com/users/AnneLaureF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnneLaureF/subscriptions","organizations_url":"https://api.github.com/users/AnneLaureF/orgs","repos_url":"https://api.github.com/users/AnneLaureF/repos","events_url":"https://api.github.com/users/AnneLaureF/events{/privacy}","received_events_url":"https://api.github.com/users/AnneLaureF/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T07:59:55Z","updated_at":"2015-01-09T07:59:55Z","body":"This issue seems to be fixed with commit a6d00a77271451fc7ff09301408fa229847a1293\r\nThe only remaining issue is that when the number of rows is too small to fill the viewport height, the calculated `y.percentage` is neither `0` nor `1` so it still prevents the whole page to be scrolled."}}