Merge branch 'fix/imm' of https://github.com/vespr-wallet/flutter_inappwebview into vespr-wallet-fix/imm
This commit is contained in:
commit
fb7e025ee0
|
@ -1525,7 +1525,15 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie
|
||||||
public void run() {
|
public void run() {
|
||||||
InputMethodManager imm =
|
InputMethodManager imm =
|
||||||
(InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
|
(InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||||
if (containerView != null && imm != null && !imm.isAcceptingText()) {
|
boolean isAcceptingText = false;
|
||||||
|
try {
|
||||||
|
if (imm != null) {
|
||||||
|
// imm.isAcceptingText() seems to sometimes crash on some devices
|
||||||
|
isAcceptingText = imm.isAcceptingText();
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
if (containerView != null && imm != null && !isAcceptingText) {
|
||||||
imm.hideSoftInputFromWindow(
|
imm.hideSoftInputFromWindow(
|
||||||
containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1878,7 +1878,7 @@ class InAppWebViewController {
|
||||||
///- MacOS ([Official API - WKWebView.canGoBack](https://developer.apple.com/documentation/webkit/wkwebview/1414966-cangoback))
|
///- MacOS ([Official API - WKWebView.canGoBack](https://developer.apple.com/documentation/webkit/wkwebview/1414966-cangoback))
|
||||||
Future<bool> canGoBack() async {
|
Future<bool> canGoBack() async {
|
||||||
Map<String, dynamic> args = <String, dynamic>{};
|
Map<String, dynamic> args = <String, dynamic>{};
|
||||||
return await _channel?.invokeMethod('canGoBack', args);
|
return await _channel?.invokeMethod<bool>('canGoBack', args) ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Goes forward in the history of the WebView.
|
///Goes forward in the history of the WebView.
|
||||||
|
@ -1903,7 +1903,7 @@ class InAppWebViewController {
|
||||||
///- MacOS ([Official API - WKWebView.canGoForward](https://developer.apple.com/documentation/webkit/wkwebview/1414962-cangoforward))
|
///- MacOS ([Official API - WKWebView.canGoForward](https://developer.apple.com/documentation/webkit/wkwebview/1414962-cangoforward))
|
||||||
Future<bool> canGoForward() async {
|
Future<bool> canGoForward() async {
|
||||||
Map<String, dynamic> args = <String, dynamic>{};
|
Map<String, dynamic> args = <String, dynamic>{};
|
||||||
return await _channel?.invokeMethod('canGoForward', args);
|
return await _channel?.invokeMethod('canGoForward', args) ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.
|
///Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.
|
||||||
|
|
Loading…
Reference in New Issue