{"action":"created","issue":{"url":"https://api.github.com/repos/JedWatson/react-select/issues/2861","repository_url":"https://api.github.com/repos/JedWatson/react-select","labels_url":"https://api.github.com/repos/JedWatson/react-select/issues/2861/labels{/name}","comments_url":"https://api.github.com/repos/JedWatson/react-select/issues/2861/comments","events_url":"https://api.github.com/repos/JedWatson/react-select/issues/2861/events","html_url":"https://github.com/JedWatson/react-select/pull/2861","id":345277394,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NDcxMDc4","number":2861,"title":"[v2] add listener to ScrollCaptor, even when no scroll is available on mount","user":{"login":"pyreta","id":15112854,"node_id":"MDQ6VXNlcjE1MTEyODU0","avatar_url":"https://avatars1.githubusercontent.com/u/15112854?v=4","gravatar_id":"","url":"https://api.github.com/users/pyreta","html_url":"https://github.com/pyreta","followers_url":"https://api.github.com/users/pyreta/followers","following_url":"https://api.github.com/users/pyreta/following{/other_user}","gists_url":"https://api.github.com/users/pyreta/gists{/gist_id}","starred_url":"https://api.github.com/users/pyreta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyreta/subscriptions","organizations_url":"https://api.github.com/users/pyreta/orgs","repos_url":"https://api.github.com/users/pyreta/repos","events_url":"https://api.github.com/users/pyreta/events{/privacy}","received_events_url":"https://api.github.com/users/pyreta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-27T15:49:54Z","updated_at":"2018-11-23T09:21:28Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/JedWatson/react-select/pulls/2861","html_url":"https://github.com/JedWatson/react-select/pull/2861","diff_url":"https://github.com/JedWatson/react-select/pull/2861.diff","patch_url":"https://github.com/JedWatson/react-select/pull/2861.patch"},"body":"## Current Behavior\r\nThe `onMenuScrollToBottom` callback will only fire if the dropdown menu is scrolling on mount.\r\n\r\n## Proposed Changes\r\nThe `onMenuScrollToBottom` callback always fires, regardless of whether or not the dropdown menu was scrollable on mount.\r\n\r\n## Why Change?\r\nA dropdown menu may render more options after mounting and therefore event listeners may need to be listening for scroll events.\r\n\r\n## Use case\r\nIn a project I'm working on, I'm creating a dropdown supporting pagination that loads asynchronously.  When I mount my `Select` component, my initial state is empty.  Once the user starts typing, an async request is made loading my state with options, and showing them in the dropdown.  However since the dropdown mounted with no options to start with, the `ScrollCaptor` is not listening for scroll events.  This prevents me from being able to load the next page on bottom scroll after loading options asynchronously.\r\n\r\n## CodeSandbox Example\r\nYou can see an [example here](https://codesandbox.io/s/1vq0l1p2l4) where opening the dropdown with options already loaded allows for the `onMenuScrollToBottom` callback to log \"bottom\" in the console.  However if you clear the options before opening the dropdown, the callback will not fire after options have loaded."},"comment":{"url":"https://api.github.com/repos/JedWatson/react-select/issues/comments/441189309","html_url":"https://github.com/JedWatson/react-select/pull/2861#issuecomment-441189309","issue_url":"https://api.github.com/repos/JedWatson/react-select/issues/2861","id":441189309,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTE4OTMwOQ==","user":{"login":"jossmac","id":2730833,"node_id":"MDQ6VXNlcjI3MzA4MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/2730833?v=4","gravatar_id":"","url":"https://api.github.com/users/jossmac","html_url":"https://github.com/jossmac","followers_url":"https://api.github.com/users/jossmac/followers","following_url":"https://api.github.com/users/jossmac/following{/other_user}","gists_url":"https://api.github.com/users/jossmac/gists{/gist_id}","starred_url":"https://api.github.com/users/jossmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jossmac/subscriptions","organizations_url":"https://api.github.com/users/jossmac/orgs","repos_url":"https://api.github.com/users/jossmac/repos","events_url":"https://api.github.com/users/jossmac/events{/privacy}","received_events_url":"https://api.github.com/users/jossmac/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T09:21:28Z","updated_at":"2018-11-23T09:21:28Z","author_association":"COLLABORATOR","body":"@pyreta this is a good idea, though I worry about binding a listener for every menu; especially when many won't have need for it.\r\n\r\nWhat about using a `ResizeObserver` to watch for changes?"}}
{"actor":{"display_login":"jossmac"}}