-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hitting 'Enter' after typing in search bar (ion-searchbar) will trigger 'ionCancel' #7010
Comments
yes, please provide one way to dismiss keyboard when search finish. |
+1 |
Hello all! I have tested this with the latest nightly and cannot seem to reproduce this issue, which means that it will be fixed for the upcoming beta.11 release! If you would like to try the latest nightly you can simply run |
@jgw96 when I've tried to install nightly, it installed |
As of Ionic beta 11, this issue is still not fixed and as @jgw96 said, this wasn't fixed before beta 11 arrived. Please reopen this issue (@brandyscarney, @adamdbradley, @jgw96), since its still affecting form and ion-searchbar:
this will always clear the ion-searchbar input after we press the enter key, which is of course, false. This is, pretty bad workaround:
submit button must be there, but I've set the |
I'm having the same issue! Any fix to submit inside form without clear search bar? |
why has this been closed? I'm still experiencing this issue. |
@janein its probably because @adamdbradley or @manucorporat updated the code. That means it is (hopefully) fixed in next version. |
Ok thanks. So I guess I have to wait for the next release until i can build my searchbar correctly. |
yes, it was fixed here. 2e1bb4b |
Short description of the problem:
When wrapped in
<form></form>
element,ion-searchbar
will incorrectly trigger eventionCancel
when user hits Enter or its equivalent (like an Action Button from iOS system keyboard). This will clear the user input, which is not expected.Otherwise, when
ion-searchbar
is not wrapped in<form></form>
, there is no issue and the user input stays after Enter key is hit, which is expected.What behavior are you expecting?
Whenever user hits Enter,
ios-searchbar
should not clear input automatically, whether or not the saidion-searchbar
is wrapped by a<form></form>
.Steps to reproduce:
ion-searchbar
wrapped in<form />
(sample code below, also shown in Plunker attached later)Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
To give some background, the reason I want to wrap
ion-searchbar
inside a<form></form>
is to make iOS Safari recognize the search bar and bring up the keyboard with blue action buttonSearch
. I'd like to know it if there is another way to archive this.Upon investigation, the origin of such ionCancel event is the click event of the Cancel button for Android, which ion-searchbar has reserved in its template to support Material Design on applicable platforms. To verify this theory, please see the Plunker sample below to see detailed instructions.
Which Ionic Version? 1.x or 2.x
2.0.0-beta9
Plunker that shows an example of your issue
http://plnkr.co/edit/UlbuOJTbDIQfymNXIXag?p=preview
Run
ionic info
from terminal/cmd prompt: (paste output below)The text was updated successfully, but these errors were encountered: