{"action":"created","issue":{"url":"https://api.github.com/repos/bvaughn/react-virtualized/issues/627","repository_url":"https://api.github.com/repos/bvaughn/react-virtualized","labels_url":"https://api.github.com/repos/bvaughn/react-virtualized/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/bvaughn/react-virtualized/issues/627/comments","events_url":"https://api.github.com/repos/bvaughn/react-virtualized/issues/627/events","html_url":"https://github.com/bvaughn/react-virtualized/issues/627","id":216599727,"number":627,"title":"overscanIndicesGetter doesnt know if its a horizontal or vertical scroll","user":{"login":"offsky","id":1110926,"avatar_url":"https://avatars1.githubusercontent.com/u/1110926?v=3","gravatar_id":"","url":"https://api.github.com/users/offsky","html_url":"https://github.com/offsky","followers_url":"https://api.github.com/users/offsky/followers","following_url":"https://api.github.com/users/offsky/following{/other_user}","gists_url":"https://api.github.com/users/offsky/gists{/gist_id}","starred_url":"https://api.github.com/users/offsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offsky/subscriptions","organizations_url":"https://api.github.com/users/offsky/orgs","repos_url":"https://api.github.com/users/offsky/repos","events_url":"https://api.github.com/users/offsky/events{/privacy}","received_events_url":"https://api.github.com/users/offsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-23T23:12:25Z","updated_at":"2017-03-24T15:54:14Z","closed_at":null,"body":"If you implement `overscanIndicesGetter`, it gets called twice on every scroll event. Once to get the horizontal value and again to get the vertical value.  However, nothing is passed in to let us know which  of these it is.  If we want to return different values for horizontal vs vertical scrolling, it isn't possible.\r\n\r\nThis is what the code is\r\n```\r\n      const overscanColumnIndices = overscanIndicesGetter({\r\n        cellCount: columnCount,\r\n        overscanCellsCount: overscanColumnCount,\r\n        scrollDirection: scrollDirectionHorizontal,\r\n        startIndex: this._renderedColumnStartIndex,\r\n        stopIndex: this._renderedColumnStopIndex\r\n      })\r\n\r\n      const overscanRowIndices = overscanIndicesGetter({\r\n        cellCount: rowCount,\r\n        overscanCellsCount: overscanRowCount,\r\n        scrollDirection: scrollDirectionVertical,\r\n        startIndex: this._renderedRowStartIndex,\r\n        stopIndex: this._renderedRowStopIndex\r\n      })\r\n```\r\n\r\nI propose passing another value for horiz/vertical scrolling.  Something like this:\r\n\r\n```\r\n      const overscanColumnIndices = overscanIndicesGetter({\r\n        cellCount: columnCount,\r\n        overscanCellsCount: overscanColumnCount,\r\n        scrollDirection: scrollDirectionHorizontal,\r\n        horizontal: true,\r\n        startIndex: this._renderedColumnStartIndex,\r\n        stopIndex: this._renderedColumnStopIndex\r\n      })\r\n\r\n      const overscanRowIndices = overscanIndicesGetter({\r\n        cellCount: rowCount,\r\n        overscanCellsCount: overscanRowCount,\r\n        scrollDirection: scrollDirectionVertical,\r\n        horizontal: false,\r\n        startIndex: this._renderedRowStartIndex,\r\n        stopIndex: this._renderedRowStopIndex\r\n      })\r\n```\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/bvaughn/react-virtualized/issues/comments/289062889","html_url":"https://github.com/bvaughn/react-virtualized/issues/627#issuecomment-289062889","issue_url":"https://api.github.com/repos/bvaughn/react-virtualized/issues/627","id":289062889,"user":{"login":"offsky","id":1110926,"avatar_url":"https://avatars1.githubusercontent.com/u/1110926?v=3","gravatar_id":"","url":"https://api.github.com/users/offsky","html_url":"https://github.com/offsky","followers_url":"https://api.github.com/users/offsky/followers","following_url":"https://api.github.com/users/offsky/following{/other_user}","gists_url":"https://api.github.com/users/offsky/gists{/gist_id}","starred_url":"https://api.github.com/users/offsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offsky/subscriptions","organizations_url":"https://api.github.com/users/offsky/orgs","repos_url":"https://api.github.com/users/offsky/repos","events_url":"https://api.github.com/users/offsky/events{/privacy}","received_events_url":"https://api.github.com/users/offsky/received_events","type":"User","site_admin":false},"created_at":"2017-03-24T15:54:14Z","updated_at":"2017-03-24T15:54:14Z","body":"I'll do this.  One additional thing to consider. When using a List, the overscanIndexGetter is being called for both Horizontal and Vertical, even though there is no horizontal.  Should I also optimize this away so that Lists don't ask the overscanner for horizontal?"}}
{"actor":{"display_login":"offsky"}}