From e225a115d4c6104e365f626842eda56bb1bf7944 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Mon, 9 Dec 2024 00:55:05 +0700 Subject: [PATCH 1/2] TW-1935: Change `dragDevices` to disable scrolling in a ListView when hovers over the screen --- lib/pages/chat/chat_event_list.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index 3288596bc..4401c4fb8 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -76,8 +76,6 @@ class ChatEventList extends StatelessWidget { behavior: ScrollConfiguration.of(context).copyWith( dragDevices: { PointerDeviceKind.touch, - PointerDeviceKind.mouse, - PointerDeviceKind.trackpad, }, ), child: SelectionTextContainer( From 58ea48684e258942a2db14377a912899f33b371c Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Mon, 9 Dec 2024 11:30:13 +0700 Subject: [PATCH 2/2] fixup! TW-1935: Change `dragDevices` to disable scrolling in a ListView when hovers over the screen --- lib/pages/chat/chat_event_list.dart | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index 4401c4fb8..2b30f6ccd 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -74,9 +74,7 @@ class ChatEventList extends StatelessWidget { }, child: ScrollConfiguration( behavior: ScrollConfiguration.of(context).copyWith( - dragDevices: { - PointerDeviceKind.touch, - }, + dragDevices: dragDevicesSupported(), ), child: SelectionTextContainer( chatController: controller, @@ -212,6 +210,19 @@ class ChatEventList extends StatelessWidget { ); } + Set? dragDevicesSupported() { + if (PlatformInfos.isWeb) { + return { + PointerDeviceKind.touch, + }; + } + return { + PointerDeviceKind.touch, + PointerDeviceKind.mouse, + PointerDeviceKind.trackpad, + }; + } + Widget _chatEmptyBuilder(Timeline timeline) { if (controller.room?.isDirectChat ?? true) { return DraftChatEmpty(