{"action":"created","issue":{"url":"https://api.github.com/repos/callemall/material-ui/issues/5018","repository_url":"https://api.github.com/repos/callemall/material-ui","labels_url":"https://api.github.com/repos/callemall/material-ui/issues/5018/labels{/name}","comments_url":"https://api.github.com/repos/callemall/material-ui/issues/5018/comments","events_url":"https://api.github.com/repos/callemall/material-ui/issues/5018/events","html_url":"https://github.com/callemall/material-ui/pull/5018","id":171898543,"number":5018,"title":"[AutoComplete] Add multiselect & selectedOptions features + improvements","user":{"login":"Sharlaan","id":2692027,"avatar_url":"https://avatars.githubusercontent.com/u/2692027?v=3","gravatar_id":"","url":"https://api.github.com/users/Sharlaan","html_url":"https://github.com/Sharlaan","followers_url":"https://api.github.com/users/Sharlaan/followers","following_url":"https://api.github.com/users/Sharlaan/following{/other_user}","gists_url":"https://api.github.com/users/Sharlaan/gists{/gist_id}","starred_url":"https://api.github.com/users/Sharlaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sharlaan/subscriptions","organizations_url":"https://api.github.com/users/Sharlaan/orgs","repos_url":"https://api.github.com/users/Sharlaan/repos","events_url":"https://api.github.com/users/Sharlaan/events{/privacy}","received_events_url":"https://api.github.com/users/Sharlaan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/callemall/material-ui/labels/PR:%20Needs%20Rebase","name":"PR: Needs Rebase","color":"ff9933"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-18T13:17:49Z","updated_at":"2016-09-19T16:51:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/callemall/material-ui/pulls/5018","html_url":"https://github.com/callemall/material-ui/pull/5018","diff_url":"https://github.com/callemall/material-ui/pull/5018.diff","patch_url":"https://github.com/callemall/material-ui/pull/5018.patch"},"body":"# AutoComplete with multiple selections and pre-selections\r\n- [ ] PR has tests.\r\n- [x] PR has docs demo,\r\n- [x] PR is linted (babel-eslint, StandardJS), dev'd with Webstorm 2016.2.2.\r\n- [x] PR title begin with [ComponentName], and are in imperative form: \"[Component] Fix leaky abstraction\".\r\n- [x] Description explains the issue / use-case resolved, and auto-closes the related issue(s)\r\n\r\n## Demo\r\nCodeExample page showing all 3 usecases:\r\na. single value Autocomplete\r\nb. multiselect autocomplete (with checkboxes)\r\nc. multiselect autocomplete (without checkboxes and with MenuItem nodes)\r\nAn external container below the 3 autocompletes shows the selected options with Chips\r\n\r\n![usage](https://cloud.githubusercontent.com/assets/2692027/17787922/89b73e34-658b-11e6-85b1-acfb753f287b.png)\r\n\r\n## New properties\r\n- _multiple_ : Default: false. If set to true, the first argument of onNewRequest's signature will become an array. Its content will be the same as of dataSource, ie array of Strings if dataSource is an Array[String], array of objects or array of nodes.\r\n- _withCheckboxes_ : Default: true. If multiple is true, the dropdown menu will use checkboxes. If multiple===true && withCheckboxes===false, selecting an option hides it from the popover.\r\n- _selectedOptions_ : Default: []. If multiple is true, the component's internal state will use this property to set preselectedOptions during componentWillMount phase. This property can also be used to notify the component of externally selected values (example: deselecting a Chip'ed value will notify the component to uncheck corresponding checkbox).\r\nNote: in all cases, the textfield responsibility is only for searching terms, displaying results is externalized to another component, via onNewRequest(results, index).\r\n- _dataSourceConfig_ now has a new 'node' property, more explicit when developper wants to use a node instead of a string.\r\n\r\n## Improvements\r\n- removed timeout hack between popover's focus and searchTextField's onBlur. UIevents (W3C) defines Blur phase triggering always before Focus, so i added in onBlur handler a check if the focused node is  one of the popover's children, or anything else (clickaway), using [relatedTarget](http://www.w3schools.com/jsref/event_focus_relatedtarget.asp).\r\n- rewrote the code with ES7.\r\n- refactored the requestsList rendering.\r\n\r\n## Known issues\r\n- Untested under mobile environmentsand Edge (tested on Chrome52 and Firefox48)\r\n\r\n## Related issues\r\nAlternative implementation: [#4252](https://github.com/callemall/material-ui/issues/4252)\r\ncloses [#4952](https://github.com/callemall/material-ui/issues/4952)\r\ncloses [#1956](https://github.com/callemall/material-ui/issues/1956)\r\n\r\nPlease report me any bugs or suggestions !"},"comment":{"url":"https://api.github.com/repos/callemall/material-ui/issues/comments/248050478","html_url":"https://github.com/callemall/material-ui/pull/5018#issuecomment-248050478","issue_url":"https://api.github.com/repos/callemall/material-ui/issues/5018","id":248050478,"user":{"login":"Sharlaan","id":2692027,"avatar_url":"https://avatars.githubusercontent.com/u/2692027?v=3","gravatar_id":"","url":"https://api.github.com/users/Sharlaan","html_url":"https://github.com/Sharlaan","followers_url":"https://api.github.com/users/Sharlaan/followers","following_url":"https://api.github.com/users/Sharlaan/following{/other_user}","gists_url":"https://api.github.com/users/Sharlaan/gists{/gist_id}","starred_url":"https://api.github.com/users/Sharlaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sharlaan/subscriptions","organizations_url":"https://api.github.com/users/Sharlaan/orgs","repos_url":"https://api.github.com/users/Sharlaan/repos","events_url":"https://api.github.com/users/Sharlaan/events{/privacy}","received_events_url":"https://api.github.com/users/Sharlaan/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T16:51:42Z","updated_at":"2016-09-19T16:51:42Z","body":"Just found an excellent alternative:\r\nhttps://github.com/TeamWertarbyte/material-ui-chip-input"}}
{"actor":{"display_login":"Sharlaan"}}