TF-1534 Fix cannot selection text on iOS

This commit is contained in:
dab246
2024-03-21 01:39:24 +07:00
committed by Dat H. Pham
parent 0b10bf6944
commit 2cff08cdf1
@@ -65,12 +65,12 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
super.initState();
if (PlatformInfo.isAndroid) {
_gestureRecognizers = {
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer()),
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer(duration: _longPressGestureDuration)),
Factory<ScaleGestureRecognizer>(() => ScaleGestureRecognizer()),
};
} else {
_gestureRecognizers = {
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer()),
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer(duration: _longPressGestureDuration)),
};
}
if (PlatformInfo.isAndroid) {
@@ -153,9 +153,9 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
}
void _onLoadStop(InAppWebViewController controller, WebUri? webUri) async {
log('_HtmlContentViewState::_onLoadStop:');
await _getActualSizeHtmlViewer();
_loadingBarNotifier.value = false;
log('_HtmlContentViewState::_onLoadStop: GestureRecognizers = $_gestureRecognizers');
}
void _onContentSizeChanged(
@@ -211,7 +211,7 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
if (!isScrollActivated && PlatformInfo.isIOS) {
newGestureRecognizers = {
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer()),
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer(duration: _longPressGestureDuration)),
Factory<HorizontalDragGestureRecognizer>(() => HorizontalDragGestureRecognizer())
};
}
@@ -272,6 +272,8 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
return NavigationActionPolicy.CANCEL;
}
Duration? get _longPressGestureDuration => const Duration(milliseconds: 100);
@override
void dispose() {
_loadingBarNotifier.dispose();