Skip to content
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

Searchbar doesn't fire blur event. #7158

Closed
viniciusgandrade opened this issue Jul 1, 2016 · 4 comments
Closed

Searchbar doesn't fire blur event. #7158

viniciusgandrade opened this issue Jul 1, 2016 · 4 comments
Labels
needs: reply the issue needs a response from the user

Comments

@viniciusgandrade
Copy link

Short description of the problem:

When tap a searchbar, keyboard shows up. When focusing out or scrolling the list, the keyboard doesn't hide.

What behavior are you expecting?

I suppose that the correct behaviour, like in native apps, is to hide the keyboard when tap the list or out of the searchbar.

A possible solution is something like the input-native solution. In a older version of ionic, the problem was the same:

@Component({
    selector: 'ion-searchbar',
    host: {
        '[class.searchbar-has-value]': '_value',
        '[class.searchbar-active]': '_isActive',
        '[class.searchbar-show-cancel]': 'showCancelButton',
        '[class.searchbar-left-aligned]': 'shouldAlignLeft()'
    },
    directives: [NativeInput],
    template:
    '<div class="searchbar-input-container">' +
    '<button (click)="cancelSearchbar($event)" (mousedown)="cancelSearchbar($event)" ' +
    'clear dark class="searchbar-md-cancel">' +
    '<ion-icon name="arrow-back"></ion-icon>' +
    '</button>' +
    '<div #searchbarIcon class="searchbar-search-icon"></div>' +
    '<input #searchbarInput [(ngModel)]="_value" [attr.placeholder]="placeholder" ' +
    '(input)="inputChanged($event)" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" ' +
    'class="searchbar-input text-input">' +
    '<button clear class="searchbar-clear-icon" (click)="clearInput($event)" ' +
    '(mousedown)="clearInput($event)"></button>' +
    '</div>' +
    '<button #cancelButton [tabindex]="_isActive ? 1 : -1" clear (click)="cancelSearchbar($event)" ' +
    '(mousedown)="cancelSearchbar($event)" class="searchbar-ios-cancel">{{cancelButtonText}}</button>',
    encapsulation: ViewEncapsulation.None
})

I'm just add the class text-input to the tag and it's works.

@jgw96
Copy link
Contributor

jgw96 commented Jul 22, 2016

Hello, thanks for opening an issue with us! Are you still having this issue with beta.10? I cant seem to reproduce on my iphone or any of my Android devices. Thanks!

@jgw96 jgw96 added the needs: reply the issue needs a response from the user label Jul 22, 2016
@jgw96
Copy link
Contributor

jgw96 commented Jul 27, 2016

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

@jgw96 jgw96 closed this as completed Jul 27, 2016
@alexandrzavalii
Copy link

I have the same issue on iphone 5. I have tested on android and it works fine.
does anyone have a fix?

@biesbjerg
Copy link

@alexandrzavalii There's a workaround in #8933

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: reply the issue needs a response from the user
Projects
None yet
Development

No branches or pull requests

6 participants