{"action":"created","issue":{"url":"https://api.github.com/repos/JedWatson/react-select/issues/2695","repository_url":"https://api.github.com/repos/JedWatson/react-select","labels_url":"https://api.github.com/repos/JedWatson/react-select/issues/2695/labels{/name}","comments_url":"https://api.github.com/repos/JedWatson/react-select/issues/2695/comments","events_url":"https://api.github.com/repos/JedWatson/react-select/issues/2695/events","html_url":"https://github.com/JedWatson/react-select/pull/2695","id":330624695,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNTg4MjIx","number":2695,"title":"Change isOptionDisabled to have the same inputs as isOptionSelected","user":{"login":"SimeonC","id":1085899,"node_id":"MDQ6VXNlcjEwODU4OTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1085899?v=4","gravatar_id":"","url":"https://api.github.com/users/SimeonC","html_url":"https://github.com/SimeonC","followers_url":"https://api.github.com/users/SimeonC/followers","following_url":"https://api.github.com/users/SimeonC/following{/other_user}","gists_url":"https://api.github.com/users/SimeonC/gists{/gist_id}","starred_url":"https://api.github.com/users/SimeonC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimeonC/subscriptions","organizations_url":"https://api.github.com/users/SimeonC/orgs","repos_url":"https://api.github.com/users/SimeonC/repos","events_url":"https://api.github.com/users/SimeonC/events{/privacy}","received_events_url":"https://api.github.com/users/SimeonC/received_events","type":"User","site_admin":false},"labels":[{"id":690274603,"node_id":"MDU6TGFiZWw2OTAyNzQ2MDM=","url":"https://api.github.com/repos/JedWatson/react-select/labels/uncertain","name":"uncertain","color":"3e3472","default":false},{"id":436631517,"node_id":"MDU6TGFiZWw0MzY2MzE1MTc=","url":"https://api.github.com/repos/JedWatson/react-select/labels/v2","name":"v2","color":"666666","default":false}],"state":"open","locked":false,"assignee":{"login":"gwyneplaine","id":12119389,"node_id":"MDQ6VXNlcjEyMTE5Mzg5","avatar_url":"https://avatars1.githubusercontent.com/u/12119389?v=4","gravatar_id":"","url":"https://api.github.com/users/gwyneplaine","html_url":"https://github.com/gwyneplaine","followers_url":"https://api.github.com/users/gwyneplaine/followers","following_url":"https://api.github.com/users/gwyneplaine/following{/other_user}","gists_url":"https://api.github.com/users/gwyneplaine/gists{/gist_id}","starred_url":"https://api.github.com/users/gwyneplaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwyneplaine/subscriptions","organizations_url":"https://api.github.com/users/gwyneplaine/orgs","repos_url":"https://api.github.com/users/gwyneplaine/repos","events_url":"https://api.github.com/users/gwyneplaine/events{/privacy}","received_events_url":"https://api.github.com/users/gwyneplaine/received_events","type":"User","site_admin":false},"assignees":[{"login":"gwyneplaine","id":12119389,"node_id":"MDQ6VXNlcjEyMTE5Mzg5","avatar_url":"https://avatars1.githubusercontent.com/u/12119389?v=4","gravatar_id":"","url":"https://api.github.com/users/gwyneplaine","html_url":"https://github.com/gwyneplaine","followers_url":"https://api.github.com/users/gwyneplaine/followers","following_url":"https://api.github.com/users/gwyneplaine/following{/other_user}","gists_url":"https://api.github.com/users/gwyneplaine/gists{/gist_id}","starred_url":"https://api.github.com/users/gwyneplaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwyneplaine/subscriptions","organizations_url":"https://api.github.com/users/gwyneplaine/orgs","repos_url":"https://api.github.com/users/gwyneplaine/repos","events_url":"https://api.github.com/users/gwyneplaine/events{/privacy}","received_events_url":"https://api.github.com/users/gwyneplaine/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-06-08T11:38:54Z","updated_at":"2018-06-27T06:49:57Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/JedWatson/react-select/pulls/2695","html_url":"https://github.com/JedWatson/react-select/pull/2695","diff_url":"https://github.com/JedWatson/react-select/pull/2695.diff","patch_url":"https://github.com/JedWatson/react-select/pull/2695.patch"},"body":"As we pass the selected values to isOptionSelected, it makes sense to pass them to isOptionDisabled as well. Allows for much more dynamic select lists.\r\n\r\n#### Some context\r\n\r\nIn the code for the following image I have auto selecting checkboxes, I'd like to also auto disable them using very similar logic which requires `isOptionDisabled` to be passed the list of selected options.\r\nCode snippets after the image.\r\n\r\n![screencast 2018-06-08 20-35-45](https://user-images.githubusercontent.com/1085899/41156173-bb6423ca-6b5b-11e8-9a05-2b78e207dc34.gif)\r\nmy data structure simulates groups by concatenating ids, something like this:\r\n```js\r\nitems={[\r\n  ...\r\n  { label: 'fr 1', value: 'sh1,sh2' },\r\n  { label: 'Shop 1', value: 'sh1' },\r\n  { label: 'Shop 2', value: 'sh2' }\r\n  ...\r\n]}\r\n```\r\n\r\nThen my select implementation goes something like this:\r\n```jsx\r\n<Select\r\n  isOptionSelected={(option, options) => {\r\n    for (let i = 0; i < options.length; i += 1) {\r\n      if (\r\n        options[i].value === option.value ||\r\n        options[i].value.indexOf(option.value) >= 0\r\n      )\r\n        return true;\r\n    }\r\n    return false;\r\n  }}\r\n  options={...}\r\n/>\r\n```"},"comment":{"url":"https://api.github.com/repos/JedWatson/react-select/issues/comments/400562109","html_url":"https://github.com/JedWatson/react-select/pull/2695#issuecomment-400562109","issue_url":"https://api.github.com/repos/JedWatson/react-select/issues/2695","id":400562109,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDU2MjEwOQ==","user":{"login":"gwyneplaine","id":12119389,"node_id":"MDQ6VXNlcjEyMTE5Mzg5","avatar_url":"https://avatars1.githubusercontent.com/u/12119389?v=4","gravatar_id":"","url":"https://api.github.com/users/gwyneplaine","html_url":"https://github.com/gwyneplaine","followers_url":"https://api.github.com/users/gwyneplaine/followers","following_url":"https://api.github.com/users/gwyneplaine/following{/other_user}","gists_url":"https://api.github.com/users/gwyneplaine/gists{/gist_id}","starred_url":"https://api.github.com/users/gwyneplaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwyneplaine/subscriptions","organizations_url":"https://api.github.com/users/gwyneplaine/orgs","repos_url":"https://api.github.com/users/gwyneplaine/repos","events_url":"https://api.github.com/users/gwyneplaine/events{/privacy}","received_events_url":"https://api.github.com/users/gwyneplaine/received_events","type":"User","site_admin":false},"created_at":"2018-06-27T06:49:57Z","updated_at":"2018-06-27T06:49:57Z","author_association":"COLLABORATOR","body":"@SimeonC, this looks good, but in the case of isOptionDisabled, I'm not entirely sure what the value of passing through the selectedValue array, it may make more sense to pass through the options array instead. Would like your thoughts on this, otherwise this lgtm "}}
{"actor":{"display_login":"gwyneplaine"}}