fixed find empty string iOS, updated tests
This commit is contained in:
parent
17bdf84362
commit
05cb0184fc
@ -47,10 +47,7 @@ void findInteractions() {
|
|||||||
await expectLater(
|
await expectLater(
|
||||||
findInteractionController.findAll(find: firstSearchText),
|
findInteractionController.findAll(find: firstSearchText),
|
||||||
completes);
|
completes);
|
||||||
if ([TargetPlatform.iOS, TargetPlatform.macOS]
|
expect(await findInteractionController.getSearchText(), firstSearchText);
|
||||||
.contains(defaultTargetPlatform)) {
|
|
||||||
expect(await findInteractionController.getSearchText(), firstSearchText);
|
|
||||||
}
|
|
||||||
if ([TargetPlatform.android].contains(defaultTargetPlatform)) {
|
if ([TargetPlatform.android].contains(defaultTargetPlatform)) {
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 1));
|
||||||
}
|
}
|
||||||
@ -62,11 +59,11 @@ void findInteractions() {
|
|||||||
findInteractionController.findNext(forward: false), completes);
|
findInteractionController.findNext(forward: false), completes);
|
||||||
await expectLater(findInteractionController.clearMatches(), completes);
|
await expectLater(findInteractionController.clearMatches(), completes);
|
||||||
|
|
||||||
|
const secondSearchText = "text";
|
||||||
|
await expectLater(
|
||||||
|
findInteractionController.setSearchText(secondSearchText), completes);
|
||||||
if ([TargetPlatform.iOS, TargetPlatform.macOS]
|
if ([TargetPlatform.iOS, TargetPlatform.macOS]
|
||||||
.contains(defaultTargetPlatform)) {
|
.contains(defaultTargetPlatform)) {
|
||||||
const secondSearchText = "text";
|
|
||||||
await expectLater(
|
|
||||||
findInteractionController.setSearchText(secondSearchText), completes);
|
|
||||||
await expectLater(
|
await expectLater(
|
||||||
findInteractionController.presentFindNavigator(), completes);
|
findInteractionController.presentFindNavigator(), completes);
|
||||||
expect(await findInteractionController.getSearchText(), secondSearchText);
|
expect(await findInteractionController.getSearchText(), secondSearchText);
|
||||||
|
@ -94,7 +94,7 @@ public class FindInteractionController : NSObject, Disposable {
|
|||||||
if let completionHandler = completionHandler {
|
if let completionHandler = completionHandler {
|
||||||
completionHandler(nil, nil)
|
completionHandler(nil, nil)
|
||||||
}
|
}
|
||||||
} else {
|
} else if find != "" {
|
||||||
let startSearch = "window.\(JAVASCRIPT_BRIDGE_NAME)._findAllAsync('\(find)');"
|
let startSearch = "window.\(JAVASCRIPT_BRIDGE_NAME)._findAllAsync('\(find)');"
|
||||||
webView.evaluateJavaScript(startSearch, completionHandler: completionHandler)
|
webView.evaluateJavaScript(startSearch, completionHandler: completionHandler)
|
||||||
}
|
}
|
||||||
|
@ -1206,6 +1206,12 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if #available(iOS 16.0, *) {
|
||||||
|
if newSettingsMap["isFindInteractionEnabled"] != nil, settings?.isFindInteractionEnabled != newSettings.isFindInteractionEnabled {
|
||||||
|
isFindInteractionEnabled = newSettings.isFindInteractionEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
scrollView.isScrollEnabled = !(newSettings.disableVerticalScroll && newSettings.disableHorizontalScroll)
|
scrollView.isScrollEnabled = !(newSettings.disableVerticalScroll && newSettings.disableHorizontalScroll)
|
||||||
|
|
||||||
self.settings = newSettings
|
self.settings = newSettings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user