Skip to content

setFocus() on ion-searchbar not working on ios #12119

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

Closed
tobbbe opened this issue Jun 21, 2017 · 3 comments
Closed

setFocus() on ion-searchbar not working on ios #12119

tobbbe opened this issue Jun 21, 2017 · 3 comments

Comments

@tobbbe
Copy link

tobbbe commented Jun 21, 2017

Ionic version: (check one with "x")
[ ] 1.x
[ ] 2.x
[x] 3.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request

Current behavior:
On iOS: Focus not set. Nothing happens.
Works on web or android

Expected behavior:
Show keyboard and set focus on searchbar

Steps to reproduce:
http://plnkr.co/edit/t92odwR27wFM7J8rym14?p=preview

Related code:
This is set in config.xml

<preference name="KeyboardDisplayRequiresUserAction" value="false" />

Other information:
This did NOT help: https://forum.ionicframework.com/t/problem-with-searchbar-setfocus-on-ios/80055

This message is displayed in xcode console:

Cant find keyplane that supports type 5 for keyboard

I have tried using different input types (text/number).
I get the same result on real device and emulator.

Ionic info::

global packages:

    @ionic/cli-utils : 1.3.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.3.0

local packages:
    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.3.0
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Cordova Platforms               : android 6.2.3 ios 4.4.0
    Ionic Framework                 : ionic-angular 3.3.0

System:
    Node       : v6.10.1
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
@AmitMY
Copy link
Contributor

AmitMY commented Jun 21, 2017

Unfortunately, it seems to be impossible to do.
See: #11453

Unfortunately this is likely an unfixable issue. Input.focus() only works if called inside an stack initiated by a touch/mouse/keyboard event.

It is known limitation of WK and UIWebView.

@jgw96
Copy link
Contributor

jgw96 commented Jun 21, 2017

Hello all, I am going to close this issue as a duplicate of #11453. I am also going to reopen that one as it seems there is some unfinished conversation going on in that issue that may point to a new issue.

@jgw96 jgw96 closed this as completed Jun 21, 2017
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 2, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants