{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/4043","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/4043/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/4043/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/4043/events","html_url":"https://github.com/ant-design/ant-design/issues/4043","id":192174221,"number":4043,"title":"select组件onSearch事件处理，选中后下拉框无法收回","user":{"login":"whx76","id":19165238,"avatar_url":"https://avatars.githubusercontent.com/u/19165238?v=3","gravatar_id":"","url":"https://api.github.com/users/whx76","html_url":"https://github.com/whx76","followers_url":"https://api.github.com/users/whx76/followers","following_url":"https://api.github.com/users/whx76/following{/other_user}","gists_url":"https://api.github.com/users/whx76/gists{/gist_id}","starred_url":"https://api.github.com/users/whx76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whx76/subscriptions","organizations_url":"https://api.github.com/users/whx76/orgs","repos_url":"https://api.github.com/users/whx76/repos","events_url":"https://api.github.com/users/whx76/events{/privacy}","received_events_url":"https://api.github.com/users/whx76/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"RaoHai","id":566097,"avatar_url":"https://avatars.githubusercontent.com/u/566097?v=3","gravatar_id":"","url":"https://api.github.com/users/RaoHai","html_url":"https://github.com/RaoHai","followers_url":"https://api.github.com/users/RaoHai/followers","following_url":"https://api.github.com/users/RaoHai/following{/other_user}","gists_url":"https://api.github.com/users/RaoHai/gists{/gist_id}","starred_url":"https://api.github.com/users/RaoHai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaoHai/subscriptions","organizations_url":"https://api.github.com/users/RaoHai/orgs","repos_url":"https://api.github.com/users/RaoHai/repos","events_url":"https://api.github.com/users/RaoHai/events{/privacy}","received_events_url":"https://api.github.com/users/RaoHai/received_events","type":"User","site_admin":false},"assignees":[{"login":"RaoHai","id":566097,"avatar_url":"https://avatars.githubusercontent.com/u/566097?v=3","gravatar_id":"","url":"https://api.github.com/users/RaoHai","html_url":"https://github.com/RaoHai","followers_url":"https://api.github.com/users/RaoHai/followers","following_url":"https://api.github.com/users/RaoHai/following{/other_user}","gists_url":"https://api.github.com/users/RaoHai/gists{/gist_id}","starred_url":"https://api.github.com/users/RaoHai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaoHai/subscriptions","organizations_url":"https://api.github.com/users/RaoHai/orgs","repos_url":"https://api.github.com/users/RaoHai/repos","events_url":"https://api.github.com/users/RaoHai/events{/privacy}","received_events_url":"https://api.github.com/users/RaoHai/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-11-29T02:48:30Z","updated_at":"2016-12-02T08:46:52Z","closed_at":"2016-12-02T08:46:52Z","body":"<!-- Issue Template -->\r\n\r\n<!--\r\nantd 的用法咨询，建议通过以下渠道，官方 issues 目前没有足够精力提供此类咨询服务：\r\n\r\n1. [Stack Overflow](http://stackoverflow.com/questions/tagged/antd)\r\n2. [Segment Fault](https://segmentfault.com/t/antd)（中文）\r\n3. [Gitter](https://gitter.im/ant-design/ant-design)\r\n\r\n如果是报告 bug，请按照下列格式书写，并务必提供复现步骤，否则恕难解决，感谢您的支持。\r\n-->\r\n\r\n#### 发生问题的环境是：\r\n\r\n<!-- 务必提供 -->\r\n\r\n- antd 版本:2.5.0\r\n- 操作系统及其版本:win10\r\n- 浏览器及其版本:chrome 54\r\n\r\n#### 您做了什么？请提供尽可能详细的重现步骤。\r\n```import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Select } from 'antd';\r\nconst Option = Select.Option;\r\n\r\nconst Test = React.createClass({\r\n  getInitialState() {\r\n    return {\r\n      options: [],\r\n    };\r\n  },\r\n  handleChange(value) {\r\n    let options;\r\n    if (!value || value.indexOf('@') >= 0) {\r\n      options = [];\r\n    } else {\r\n      options = ['gmail.com', '163.com', 'qq.com'].map((domain) => {\r\n        const email = `${value}@${domain}`;\r\n        return <Option key={email}>{email}</Option>;\r\n      });\r\n    }\r\n    this.setState({ options });\r\n  },\r\n  render() {\r\n    // filterOption needs to be false，as the value is dynamically generated\r\n    return (\r\n      <Select combobox\r\n        style={{ width: 200 }}\r\n        onSearch={this.handleChange}\r\n        filterOption={false}\r\n        placeholder=\"Enter the account name\"\r\n      >\r\n        {this.state.options}\r\n      </Select>\r\n    );\r\n  },\r\n});\r\nconst mountNode = document.getElementById('content');\r\nReactDOM.render(<Test />, mountNode);```\r\n<!-- 如：引入 antd 了 Button -->\r\n\r\n#### 您期待的结果是:\r\n选中后下拉框收回\r\n<!-- 如：像官网一样正常显示 -->\r\n\r\n#### 实际上的结果是:\r\n选中下拉框无法收回\r\n\r\n\r\n<!-- 如：样式错位了，最好提供截图 -->\r\n\r\n#### 可重现的在线演示\r\n\r\n<!-- 请修改并 Fork http://codepen.io/benjycui/pen/KgPZrE?editors=001 -->\r\n"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/264403227","html_url":"https://github.com/ant-design/ant-design/issues/4043#issuecomment-264403227","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/4043","id":264403227,"user":{"login":"RaoHai","id":566097,"avatar_url":"https://avatars.githubusercontent.com/u/566097?v=3","gravatar_id":"","url":"https://api.github.com/users/RaoHai","html_url":"https://github.com/RaoHai","followers_url":"https://api.github.com/users/RaoHai/followers","following_url":"https://api.github.com/users/RaoHai/following{/other_user}","gists_url":"https://api.github.com/users/RaoHai/gists{/gist_id}","starred_url":"https://api.github.com/users/RaoHai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaoHai/subscriptions","organizations_url":"https://api.github.com/users/RaoHai/orgs","repos_url":"https://api.github.com/users/RaoHai/repos","events_url":"https://api.github.com/users/RaoHai/events{/privacy}","received_events_url":"https://api.github.com/users/RaoHai/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T08:46:52Z","updated_at":"2016-12-02T08:46:52Z","body":"close via https://github.com/react-component/select/commit/579f4d4679294c6f152b05a780fb3390a85238d2"}}
{"actor":{"display_login":"RaoHai"}}