Closed u01jmg3 closed 4 years ago
in order to get similar functionality on WKWebView requires swizzling private methods
It is against Apple's rules to use private methods and might lead to apps being rejected, so we will not add any code to Cordova itself that makes use of them.
It should be possible for someone to write a 3rd party plugin that provides this behaviour.
@dpogue: is there no other way to allow focussing to work correctly on iOS 12 and 13 without a third-party plugin? Do you know why this is broken in the first place?
According to Apple's view, it's not broken. This is intentional on their part: opening the keyboard always requires a user action like clicking on the page.
Thanks for the info. This seems contradictory when previously they offered the KeyboardDisplayRequiresUserAction
option in UIWebView which allowed an app developer to control this very behaviour. But I guess UIWebView is now deprecated so perhaps it is no longer considered good practice. 🤷♂️
Is there a plugin or workaround that fixes this for Cordova iOS 6+? Seems like a lot of people are missing this, according to the end user feedback I get.
Is there a plugin or workaround that fixes this for Cordova iOS 6+? Seems like a lot of people are missing this, according to the end user feedback I get.
You can try deriving from this PR https://github.com/apache/cordova-plugin-wkwebview-engine/pull/122/files
But like Darryl says, you're going against what Apple believes to be correct. Afaik, you can only accomplish this by using private APIs, which is grounds for app rejection. It can also makes your code brittle as private APIs can change with no warning.
This seems contradictory when previously they offered the KeyboardDisplayRequiresUserAction option in UIWebView which allowed an app developer to control this very behaviour.
KeyboardDisplayRequiresUserAction
is also deprecated, so I think Apple indeed reconsidered what is considered good practice.
so I think Apple indeed reconsidered what is considered good practice
But as @phemets has said, user feedback suggests this feature is missed. Are Apple correct to be dictating what our users should want? Either way, there's nothing we can do. :pensive:
Are Apple correct to be dictating what our users should want?
This isn't really anything new for Apple. They always valued simplistic design, which often includes removing features.
The proper way to get this addressed is to get into contact with Apple and request the feature. There isn't anything that can be done from Cordova.
Amazing! Works for me! Thank you, u01jmg3!
Thank @onderceylan who put me onto the fork @adaptabi created
Thank you very much @adaptabi, @onderceylan and @u01jmg3! My users will be very happy! The app update is already done and waiting for review!
Bug Report
Problem
I realise Cordova iOS
6.1.0
was released with its own copy of the WKWebView engine. I just wanted to know whether fixes previously included incordova-plugin-wkwebview-engine
for fixing input focus will be incorporated into this repo?I also realise that
KeyboardDisplayRequiresUserAction
was part of the now deprecated UIWebView and in order to get similar functionality on WKWebView requires swizzling private methods. This means any fix can break if Apple decide to change their code.What is expected to happen?
The keyboard should show when focusing an input element.
What does actually happen?
The keyboard does not show when focusing an input element.
Information
cordova-plugin-wkwebview-engine
12.2
13
cordova-plugin-ionic-webview
13
Environment, Platform, Device
iOS
12.4.8
Version information
Cordova
10.0.0
Cordova iOS6.1.0
Checklist