{"action":"created","issue":{"url":"https://api.github.com/repos/paypal/downshift/issues/480","repository_url":"https://api.github.com/repos/paypal/downshift","labels_url":"https://api.github.com/repos/paypal/downshift/issues/480/labels{/name}","comments_url":"https://api.github.com/repos/paypal/downshift/issues/480/comments","events_url":"https://api.github.com/repos/paypal/downshift/issues/480/events","html_url":"https://github.com/paypal/downshift/issues/480","id":334503936,"node_id":"MDU6SXNzdWUzMzQ1MDM5MzY=","number":480,"title":"Clear Selection via an external button click","user":{"login":"preraksola","id":8655814,"node_id":"MDQ6VXNlcjg2NTU4MTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8655814?v=4","gravatar_id":"","url":"https://api.github.com/users/preraksola","html_url":"https://github.com/preraksola","followers_url":"https://api.github.com/users/preraksola/followers","following_url":"https://api.github.com/users/preraksola/following{/other_user}","gists_url":"https://api.github.com/users/preraksola/gists{/gist_id}","starred_url":"https://api.github.com/users/preraksola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/preraksola/subscriptions","organizations_url":"https://api.github.com/users/preraksola/orgs","repos_url":"https://api.github.com/users/preraksola/repos","events_url":"https://api.github.com/users/preraksola/events{/privacy}","received_events_url":"https://api.github.com/users/preraksola/received_events","type":"User","site_admin":false},"labels":[{"id":654664869,"node_id":"MDU6TGFiZWw2NTQ2NjQ4Njk=","url":"https://api.github.com/repos/paypal/downshift/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-21T13:51:50Z","updated_at":"2018-06-22T02:21:56Z","closed_at":"2018-06-22T02:21:56Z","author_association":"NONE","body":"<!--\r\nThanks for your interest in the project. I appreciate bugs filed and PRs submitted!\r\nPlease make sure that you are familiar with and follow the Code of Conduct for\r\nthis project (found in the CODE_OF_CONDUCT.md file).\r\n\r\nPlease fill out this template with all the relevant information so we can\r\nunderstand what's going on and fix the issue.\r\n\r\nI'll probably ask you to submit the fix (after giving some direction). If you've\r\nnever done that before, that's great! Check this free short video tutorial to\r\nlearn how: http://kcd.im/pull-request\r\n-->\r\n\r\n- `downshift` version: 1.31.16\r\n- `node` version: 8.11.12\r\n- `npm` (or `yarn`) version: 5.6.0\r\n\r\nWhat you did:\r\nI have integrated downshift in a form in my react application to display a list of users fetched from an API. I have a button in this form, which is used to clear all the fields. \r\nHowever, I am not able to clear the autocomplete text field of Downshift upon clicking the button.\r\n\r\nSo, is there a way that I can use the `clearSelection` method in another function?  \r\nIf not, is there any other alternative?\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/paypal/downshift/issues/comments/399300602","html_url":"https://github.com/paypal/downshift/issues/480#issuecomment-399300602","issue_url":"https://api.github.com/repos/paypal/downshift/issues/480","id":399300602,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTMwMDYwMg==","user":{"login":"kentcdodds","id":1500684,"node_id":"MDQ6VXNlcjE1MDA2ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1500684?v=4","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T02:21:56Z","updated_at":"2018-06-22T02:21:56Z","author_association":"MEMBER","body":"You can do that already. That's how refs in react work. No need to change the code.\r\n\r\nThat said, it would be very imperative so it'd probably be better to do this a different way.\r\n\r\nIf you want to control the selectedItem state outside downshift, the solution is to use control props. See the documentation for how to accomplish that. There's also [an example for this as well](https://github.com/paypal/downshift/blob/master/stories/examples/controlled.js).\r\n\r\nEither way, this is definitely possible, so I'll go ahead and close this issue. Thanks!"}}
{"actor":{"display_login":"kentcdodds"}}