Feature request: expose ion-searchbar focus/blur events
See original GitHub issueIonic version: (check one with “x”) [ ] 1.x [ ] 2.x [ + ] 3.x
I’m submitting a … (check one with “x”) [ ] bug report [ + ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior: Currently only the “ionInput” output event is exposed, which is used to detect when the content of the searchbar changes. However, there are cases where you’d want to catch the focus and blur events and execute some custom action in your app. Using Angular’s (blur) and (focus) does nothing because internally those events are already intercepted.
Expected behavior: Being able to provide custom functionality on blur and focus of ion-searchbar, same as one can do that for ionInput event.
Steps to reproduce: Example use-case: I am using searchbar for the Google Places autocomplete together with a native Google Maps from @ionic-native. I need to be able to detect focus and blur events for ion-searchbar because I have to disable / enable the map taps based on whether the searchbar is in focus or not (otherwise all clicks on the Google Places suggestions dropdown get hijacked by the map).
Also, there was a question about the blur/focus detection on StackOverflow: http://stackoverflow.com/questions/43756290/how-to-detect-onfocus-and-blur-event-of-ion-searchbar-in-ionic2
Ionic info:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.6
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.7.0
Xcode version: Not installed
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
ionBlur and ionFocus is already exposed, just use:
am I missing something here? please, reopen if that didn’t work
@manucorporat that does indeed work, my bad. You can happily close the pull request 😃 However, it would be useful if you could add this into the docs somewhere, then there would be fewer cases of confusion similar to mine…