mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-28 20:49:50 +00:00
multiplatform: stop pointer handler resets on chat item recomposition (lost clicks, cursor flicker)
bigTouchSlop() created a new ViewConfiguration instance on every recomposition of every chat item; pointer input nodes observe ViewConfiguration and reset their handler when it changes, so each inserted message killed all in-flight presses (lost command clicks) and hover handlers (hand cursor flicker) in the viewport. Provide a remembered instance instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
b2a3edbc84
commit
6d24bd5d44
+5
-2
@@ -1909,10 +1909,13 @@ fun BoxScope.ChatItemsList(
|
||||
reveal: (Boolean) -> Unit
|
||||
) {
|
||||
val itemScope = rememberCoroutineScope()
|
||||
val viewConfiguration = LocalViewConfiguration.current
|
||||
CompositionLocalProvider(
|
||||
// Makes horizontal and vertical scrolling to coexist nicely.
|
||||
// With default touchSlop when you scroll LazyColumn, you can unintentionally open reply view
|
||||
LocalViewConfiguration provides LocalViewConfiguration.current.bigTouchSlop()
|
||||
// With default touchSlop when you scroll LazyColumn, you can unintentionally open reply view.
|
||||
// remember: pointerInput handlers observe ViewConfiguration and reset on any change, so a new
|
||||
// instance per recomposition kills in-flight presses/hover whenever a message is inserted
|
||||
LocalViewConfiguration provides remember(viewConfiguration) { viewConfiguration.bigTouchSlop() }
|
||||
) {
|
||||
val provider = {
|
||||
providerForGallery(reversedChatItems.value.asReversed(), cItem.id) { indexInReversed ->
|
||||
|
||||
Reference in New Issue
Block a user