{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/6382","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/6382/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/6382/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/6382/events","html_url":"https://github.com/driftyco/ionic/issues/6382","id":151896109,"number":6382,"title":"bug: Searchbar cancel event is execute input function","user":{"login":"MatanYed","id":13586343,"avatar_url":"https://avatars.githubusercontent.com/u/13586343?v=3","gravatar_id":"","url":"https://api.github.com/users/MatanYed","html_url":"https://github.com/MatanYed","followers_url":"https://api.github.com/users/MatanYed/followers","following_url":"https://api.github.com/users/MatanYed/following{/other_user}","gists_url":"https://api.github.com/users/MatanYed/gists{/gist_id}","starred_url":"https://api.github.com/users/MatanYed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatanYed/subscriptions","organizations_url":"https://api.github.com/users/MatanYed/orgs","repos_url":"https://api.github.com/users/MatanYed/repos","events_url":"https://api.github.com/users/MatanYed/events{/privacy}","received_events_url":"https://api.github.com/users/MatanYed/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic/labels/v2","name":"v2","color":"313744"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-29T15:31:09Z","updated_at":"2016-04-29T21:17:28Z","closed_at":null,"body":"**Type**: <span ionic-type>bug</span>\r\n\r\n**Ionic Version**: <span ionic-version>2.x</span>\r\n\r\n**Platform**: <span ionic-platform>all</span>  \r\n\r\n<span ionic-description>When there is no text in searchbar and you click on cancel button, the searchbar is execute the (input) function `(input)=\"loadItems($event)\"`.\r\n\r\nIt's should execute the function only if there is text in search and than clicking cancel.\r\n\r\nLook here my example here:\r\nhttps://drive.google.com/file/d/0B_2AM8ZhXhE9U3RGdEJtRF82Ujg/view\r\n\r\nI wish you understood the problem...\r\n\r\n<span is-issue-template></span>\r\n"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/215884237","html_url":"https://github.com/driftyco/ionic/issues/6382#issuecomment-215884237","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/6382","id":215884237,"user":{"login":"brandyscarney","id":6577830,"avatar_url":"https://avatars.githubusercontent.com/u/6577830?v=3","gravatar_id":"","url":"https://api.github.com/users/brandyscarney","html_url":"https://github.com/brandyscarney","followers_url":"https://api.github.com/users/brandyscarney/followers","following_url":"https://api.github.com/users/brandyscarney/following{/other_user}","gists_url":"https://api.github.com/users/brandyscarney/gists{/gist_id}","starred_url":"https://api.github.com/users/brandyscarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandyscarney/subscriptions","organizations_url":"https://api.github.com/users/brandyscarney/orgs","repos_url":"https://api.github.com/users/brandyscarney/repos","events_url":"https://api.github.com/users/brandyscarney/events{/privacy}","received_events_url":"https://api.github.com/users/brandyscarney/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T21:17:28Z","updated_at":"2016-04-29T21:17:28Z","body":"So this is because the input is cleared when clicking on the cancel button (and the input event gets emitted on the clear function. We could add a check that the input has a value prior to clearing it and only emit the `input` event when there is.\r\n\r\nhttps://github.com/driftyco/ionic/blob/2.0/ionic/components/searchbar/searchbar.ts#L313"}}