@zenkit-dev/cordova-plugin-wkwebview-inputfocusfix 1.0.5-dev.0 → 1.0.5-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenkit-dev/cordova-plugin-wkwebview-inputfocusfix",
|
|
3
3
|
"description": "Cordova plugin for fixing auto focus issue of html elements on WKWebView",
|
|
4
|
-
"version": "1.0.5-dev.
|
|
4
|
+
"version": "1.0.5-dev.1",
|
|
5
5
|
"author": "Zenkit <info@zenkit.com>",
|
|
6
6
|
"repository": "https://github.com/zenkit/cordova-plugin-wkwebview-inputfocusfix.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -19,6 +19,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
19
19
|
// https://stackoverflow.com/a/48623286/3297914
|
|
20
20
|
- (void) keyboardDisplayDoesNotRequireUserAction {
|
|
21
21
|
Class class = NSClassFromString(@"WKContentView");
|
|
22
|
+
if (class == nil) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
22
25
|
NSOperatingSystemVersion iOS_11_3_0 = (NSOperatingSystemVersion){11, 3, 0};
|
|
23
26
|
NSOperatingSystemVersion iOS_12_2_0 = (NSOperatingSystemVersion){12, 2, 0};
|
|
24
27
|
NSOperatingSystemVersion iOS_13_0_0 = (NSOperatingSystemVersion){13, 0, 0};
|
|
@@ -39,6 +42,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
39
42
|
|
|
40
43
|
SEL selector = sel_getUid(methodSignature);
|
|
41
44
|
Method method = class_getInstanceMethod(class, selector);
|
|
45
|
+
if (method == NULL) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
42
48
|
IMP original = method_getImplementation(method);
|
|
43
49
|
IMP override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) {
|
|
44
50
|
((void (*)(id, SEL, void*, BOOL, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
|
|
@@ -47,6 +53,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
47
53
|
} else {
|
|
48
54
|
SEL selector = sel_getUid("_startAssistingNode:userIsInteracting:blurPreviousNode:userObject:");
|
|
49
55
|
Method method = class_getInstanceMethod(class, selector);
|
|
56
|
+
if (method == NULL) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
50
59
|
IMP original = method_getImplementation(method);
|
|
51
60
|
IMP override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, id arg3) {
|
|
52
61
|
((void (*)(id, SEL, void*, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3);
|