{"action":"opened","number":303,"pull_request":{"url":"https://api.github.com/repos/brandingbrand/flagship/pulls/303","id":236947699,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2OTQ3Njk5","html_url":"https://github.com/brandingbrand/flagship/pull/303","diff_url":"https://github.com/brandingbrand/flagship/pull/303.diff","patch_url":"https://github.com/brandingbrand/flagship/pull/303.patch","issue_url":"https://api.github.com/repos/brandingbrand/flagship/issues/303","number":303,"state":"open","locked":false,"title":"fix(fscomponents): cancel search button in android","user":{"login":"DavidRhodesBB","id":41645989,"node_id":"MDQ6VXNlcjQxNjQ1OTg5","avatar_url":"https://avatars3.githubusercontent.com/u/41645989?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidRhodesBB","html_url":"https://github.com/DavidRhodesBB","followers_url":"https://api.github.com/users/DavidRhodesBB/followers","following_url":"https://api.github.com/users/DavidRhodesBB/following{/other_user}","gists_url":"https://api.github.com/users/DavidRhodesBB/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidRhodesBB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidRhodesBB/subscriptions","organizations_url":"https://api.github.com/users/DavidRhodesBB/orgs","repos_url":"https://api.github.com/users/DavidRhodesBB/repos","events_url":"https://api.github.com/users/DavidRhodesBB/events{/privacy}","received_events_url":"https://api.github.com/users/DavidRhodesBB/received_events","type":"User","site_admin":false},"body":"The problem was IOS native includes a cancel button inside the TextInput component, which deletes any entered text, but Android native does not. To counter this, we add a Platform check for android, then render a cancel button with the correct method. The button only appears when there is text entered:\r\n\r\n```\r\nconst cancelIcon = require('../../assets/images/clear.png');\r\nconst isAndroid = Platform.OS === 'android';\r\n\r\n  renderAndroidCancelSearchIcon = () => {\r\n    if (!isAndroid || this.state.value.length === 0 || !this.state.value) {\r\n      return null;\r\n    }\r\n\r\n    const icon = <Image source={cancelIcon} style={styles.rightIcon} resizeMode='contain' />;\r\n\r\n    return (\r\n      <TouchableOpacity onPress={this.handleClear}>\r\n        {icon}\r\n      </TouchableOpacity>\r\n    );\r\n  }\r\n\r\n  handleClear = () => {\r\n    this.input.blur();\r\n    this.setState({ value: '' });\r\n    if (this.props.onChange) {\r\n      this.props.onChange('');\r\n    }\r\n  }\r\n\r\n```\r\n\r\nThen we call the renderAndroidCancelSearchIcon method inside renderInput:\r\n\r\n![screenshot_20181206-171847](https://user-images.githubusercontent.com/41645989/49664395-c91f4500-fa1f-11e8-848a-291fae9c9ef9.png)\r\n![screenshot_20181206-171912](https://user-images.githubusercontent.com/41645989/49664396-c9b7db80-fa1f-11e8-964a-d2d576e160db.png)\r\n","created_at":"2018-12-07T17:58:29Z","updated_at":"2018-12-07T17:58:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/brandingbrand/flagship/pulls/303/commits","review_comments_url":"https://api.github.com/repos/brandingbrand/flagship/pulls/303/comments","review_comment_url":"https://api.github.com/repos/brandingbrand/flagship/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brandingbrand/flagship/issues/303/comments","statuses_url":"https://api.github.com/repos/brandingbrand/flagship/statuses/e061939215694b6b681226b1455c495c3ffdf6e2","head":{"label":"DavidRhodesBB:android_search","ref":"android_search","sha":"e061939215694b6b681226b1455c495c3ffdf6e2","user":{"login":"DavidRhodesBB","id":41645989,"node_id":"MDQ6VXNlcjQxNjQ1OTg5","avatar_url":"https://avatars3.githubusercontent.com/u/41645989?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidRhodesBB","html_url":"https://github.com/DavidRhodesBB","followers_url":"https://api.github.com/users/DavidRhodesBB/followers","following_url":"https://api.github.com/users/DavidRhodesBB/following{/other_user}","gists_url":"https://api.github.com/users/DavidRhodesBB/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidRhodesBB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidRhodesBB/subscriptions","organizations_url":"https://api.github.com/users/DavidRhodesBB/orgs","repos_url":"https://api.github.com/users/DavidRhodesBB/repos","events_url":"https://api.github.com/users/DavidRhodesBB/events{/privacy}","received_events_url":"https://api.github.com/users/DavidRhodesBB/received_events","type":"User","site_admin":false},"repo":{"id":147690549,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc2OTA1NDk=","name":"flagship","full_name":"DavidRhodesBB/flagship","private":false,"owner":{"login":"DavidRhodesBB","id":41645989,"node_id":"MDQ6VXNlcjQxNjQ1OTg5","avatar_url":"https://avatars3.githubusercontent.com/u/41645989?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidRhodesBB","html_url":"https://github.com/DavidRhodesBB","followers_url":"https://api.github.com/users/DavidRhodesBB/followers","following_url":"https://api.github.com/users/DavidRhodesBB/following{/other_user}","gists_url":"https://api.github.com/users/DavidRhodesBB/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidRhodesBB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidRhodesBB/subscriptions","organizations_url":"https://api.github.com/users/DavidRhodesBB/orgs","repos_url":"https://api.github.com/users/DavidRhodesBB/repos","events_url":"https://api.github.com/users/DavidRhodesBB/events{/privacy}","received_events_url":"https://api.github.com/users/DavidRhodesBB/received_events","type":"User","site_admin":false},"html_url":"https://github.com/DavidRhodesBB/flagship","description":"🚢 A tool for building your best shopping app","fork":true,"url":"https://api.github.com/repos/DavidRhodesBB/flagship","forks_url":"https://api.github.com/repos/DavidRhodesBB/flagship/forks","keys_url":"https://api.github.com/repos/DavidRhodesBB/flagship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DavidRhodesBB/flagship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DavidRhodesBB/flagship/teams","hooks_url":"https://api.github.com/repos/DavidRhodesBB/flagship/hooks","issue_events_url":"https://api.github.com/repos/DavidRhodesBB/flagship/issues/events{/number}","events_url":"https://api.github.com/repos/DavidRhodesBB/flagship/events","assignees_url":"https://api.github.com/repos/DavidRhodesBB/flagship/assignees{/user}","branches_url":"https://api.github.com/repos/DavidRhodesBB/flagship/branches{/branch}","tags_url":"https://api.github.com/repos/DavidRhodesBB/flagship/tags","blobs_url":"https://api.github.com/repos/DavidRhodesBB/flagship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DavidRhodesBB/flagship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DavidRhodesBB/flagship/git/refs{/sha}","trees_url":"https://api.github.com/repos/DavidRhodesBB/flagship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DavidRhodesBB/flagship/statuses/{sha}","languages_url":"https://api.github.com/repos/DavidRhodesBB/flagship/languages","stargazers_url":"https://api.github.com/repos/DavidRhodesBB/flagship/stargazers","contributors_url":"https://api.github.com/repos/DavidRhodesBB/flagship/contributors","subscribers_url":"https://api.github.com/repos/DavidRhodesBB/flagship/subscribers","subscription_url":"https://api.github.com/repos/DavidRhodesBB/flagship/subscription","commits_url":"https://api.github.com/repos/DavidRhodesBB/flagship/commits{/sha}","git_commits_url":"https://api.github.com/repos/DavidRhodesBB/flagship/git/commits{/sha}","comments_url":"https://api.github.com/repos/DavidRhodesBB/flagship/comments{/number}","issue_comment_url":"https://api.github.com/repos/DavidRhodesBB/flagship/issues/comments{/number}","contents_url":"https://api.github.com/repos/DavidRhodesBB/flagship/contents/{+path}","compare_url":"https://api.github.com/repos/DavidRhodesBB/flagship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DavidRhodesBB/flagship/merges","archive_url":"https://api.github.com/repos/DavidRhodesBB/flagship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DavidRhodesBB/flagship/downloads","issues_url":"https://api.github.com/repos/DavidRhodesBB/flagship/issues{/number}","pulls_url":"https://api.github.com/repos/DavidRhodesBB/flagship/pulls{/number}","milestones_url":"https://api.github.com/repos/DavidRhodesBB/flagship/milestones{/number}","notifications_url":"https://api.github.com/repos/DavidRhodesBB/flagship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DavidRhodesBB/flagship/labels{/name}","releases_url":"https://api.github.com/repos/DavidRhodesBB/flagship/releases{/id}","deployments_url":"https://api.github.com/repos/DavidRhodesBB/flagship/deployments","created_at":"2018-09-06T14:57:48Z","updated_at":"2018-09-06T14:57:52Z","pushed_at":"2018-12-07T17:44:36Z","git_url":"git://github.com/DavidRhodesBB/flagship.git","ssh_url":"git@github.com:DavidRhodesBB/flagship.git","clone_url":"https://github.com/DavidRhodesBB/flagship.git","svn_url":"https://github.com/DavidRhodesBB/flagship","homepage":"","size":7376,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"brandingbrand:master","ref":"master","sha":"b6ba811acea1db8b5b2da201fcbc3b45f6062106","user":{"login":"brandingbrand","id":1302319,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDIzMTk=","avatar_url":"https://avatars0.githubusercontent.com/u/1302319?v=4","gravatar_id":"","url":"https://api.github.com/users/brandingbrand","html_url":"https://github.com/brandingbrand","followers_url":"https://api.github.com/users/brandingbrand/followers","following_url":"https://api.github.com/users/brandingbrand/following{/other_user}","gists_url":"https://api.github.com/users/brandingbrand/gists{/gist_id}","starred_url":"https://api.github.com/users/brandingbrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandingbrand/subscriptions","organizations_url":"https://api.github.com/users/brandingbrand/orgs","repos_url":"https://api.github.com/users/brandingbrand/repos","events_url":"https://api.github.com/users/brandingbrand/events{/privacy}","received_events_url":"https://api.github.com/users/brandingbrand/received_events","type":"Organization","site_admin":false},"repo":{"id":139191140,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxOTExNDA=","name":"flagship","full_name":"brandingbrand/flagship","private":false,"owner":{"login":"brandingbrand","id":1302319,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDIzMTk=","avatar_url":"https://avatars0.githubusercontent.com/u/1302319?v=4","gravatar_id":"","url":"https://api.github.com/users/brandingbrand","html_url":"https://github.com/brandingbrand","followers_url":"https://api.github.com/users/brandingbrand/followers","following_url":"https://api.github.com/users/brandingbrand/following{/other_user}","gists_url":"https://api.github.com/users/brandingbrand/gists{/gist_id}","starred_url":"https://api.github.com/users/brandingbrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandingbrand/subscriptions","organizations_url":"https://api.github.com/users/brandingbrand/orgs","repos_url":"https://api.github.com/users/brandingbrand/repos","events_url":"https://api.github.com/users/brandingbrand/events{/privacy}","received_events_url":"https://api.github.com/users/brandingbrand/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/brandingbrand/flagship","description":"🚢 A tool for building your best shopping app","fork":false,"url":"https://api.github.com/repos/brandingbrand/flagship","forks_url":"https://api.github.com/repos/brandingbrand/flagship/forks","keys_url":"https://api.github.com/repos/brandingbrand/flagship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brandingbrand/flagship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brandingbrand/flagship/teams","hooks_url":"https://api.github.com/repos/brandingbrand/flagship/hooks","issue_events_url":"https://api.github.com/repos/brandingbrand/flagship/issues/events{/number}","events_url":"https://api.github.com/repos/brandingbrand/flagship/events","assignees_url":"https://api.github.com/repos/brandingbrand/flagship/assignees{/user}","branches_url":"https://api.github.com/repos/brandingbrand/flagship/branches{/branch}","tags_url":"https://api.github.com/repos/brandingbrand/flagship/tags","blobs_url":"https://api.github.com/repos/brandingbrand/flagship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brandingbrand/flagship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brandingbrand/flagship/git/refs{/sha}","trees_url":"https://api.github.com/repos/brandingbrand/flagship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brandingbrand/flagship/statuses/{sha}","languages_url":"https://api.github.com/repos/brandingbrand/flagship/languages","stargazers_url":"https://api.github.com/repos/brandingbrand/flagship/stargazers","contributors_url":"https://api.github.com/repos/brandingbrand/flagship/contributors","subscribers_url":"https://api.github.com/repos/brandingbrand/flagship/subscribers","subscription_url":"https://api.github.com/repos/brandingbrand/flagship/subscription","commits_url":"https://api.github.com/repos/brandingbrand/flagship/commits{/sha}","git_commits_url":"https://api.github.com/repos/brandingbrand/flagship/git/commits{/sha}","comments_url":"https://api.github.com/repos/brandingbrand/flagship/comments{/number}","issue_comment_url":"https://api.github.com/repos/brandingbrand/flagship/issues/comments{/number}","contents_url":"https://api.github.com/repos/brandingbrand/flagship/contents/{+path}","compare_url":"https://api.github.com/repos/brandingbrand/flagship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brandingbrand/flagship/merges","archive_url":"https://api.github.com/repos/brandingbrand/flagship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brandingbrand/flagship/downloads","issues_url":"https://api.github.com/repos/brandingbrand/flagship/issues{/number}","pulls_url":"https://api.github.com/repos/brandingbrand/flagship/pulls{/number}","milestones_url":"https://api.github.com/repos/brandingbrand/flagship/milestones{/number}","notifications_url":"https://api.github.com/repos/brandingbrand/flagship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brandingbrand/flagship/labels{/name}","releases_url":"https://api.github.com/repos/brandingbrand/flagship/releases{/id}","deployments_url":"https://api.github.com/repos/brandingbrand/flagship/deployments","created_at":"2018-06-29T20:08:46Z","updated_at":"2018-12-05T20:17:49Z","pushed_at":"2018-12-07T17:01:43Z","git_url":"git://github.com/brandingbrand/flagship.git","ssh_url":"git@github.com:brandingbrand/flagship.git","clone_url":"https://github.com/brandingbrand/flagship.git","svn_url":"https://github.com/brandingbrand/flagship","homepage":"","size":7726,"stargazers_count":49,"watchers_count":49,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":36,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":36,"open_issues":73,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brandingbrand/flagship/pulls/303"},"html":{"href":"https://github.com/brandingbrand/flagship/pull/303"},"issue":{"href":"https://api.github.com/repos/brandingbrand/flagship/issues/303"},"comments":{"href":"https://api.github.com/repos/brandingbrand/flagship/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/brandingbrand/flagship/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/brandingbrand/flagship/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brandingbrand/flagship/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/brandingbrand/flagship/statuses/e061939215694b6b681226b1455c495c3ffdf6e2"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":38,"deletions":3,"changed_files":4}}
{"actor":{"display_login":"DavidRhodesBB"}}