Fixed
Status Update
Comments
so...@google.com <so...@google.com>
mo...@google.com <mo...@google.com> #2
This is working as intended. I'll discuss this internally to see if we want to start allowing children to be hit without their parents being hit.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 0e52a1eb5c67bc5ca4232c330deff139e71fa080
Author: George Mount <mount@google.com>
Date: Thu Aug 19 21:55:42 2021
Allow child PointerInputFilters to receive input outside parents
Fixes: 192479655
Children that are outside their parent PointerInputFilter bounds
can now receive events. Parents may choose to receive those events
by setting "alwaysInterceptChildEvents" to true.
Relnote: "Allow children to accept pointer input outside of
parent's pointer input bounds. Parents may intercept those
calls with a property PointerInputScope.alwaysInterceptChildEvents"
Test: new tests
Change-Id: I9eae3ce577012e26c3532266ac63db8e84ce5c7f
D compose/ui/ui/api/api_lint.ignore
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/ComposeView.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/GraphicsLayerScope.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/HitTestResult.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InnerPlaceable.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/PointerInputDelegatingWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsWrapper.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/HitTestResultTest.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
https://android-review.googlesource.com/1802812
Branch: androidx-main
commit 0e52a1eb5c67bc5ca4232c330deff139e71fa080
Author: George Mount <mount@google.com>
Date: Thu Aug 19 21:55:42 2021
Allow child PointerInputFilters to receive input outside parents
Fixes: 192479655
Children that are outside their parent PointerInputFilter bounds
can now receive events. Parents may choose to receive those events
by setting "alwaysInterceptChildEvents" to true.
Relnote: "Allow children to accept pointer input outside of
parent's pointer input bounds. Parents may intercept those
calls with a property PointerInputScope.alwaysInterceptChildEvents"
Test: new tests
Change-Id: I9eae3ce577012e26c3532266ac63db8e84ce5c7f
D compose/ui/ui/api/api_lint.ignore
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/ComposeView.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/GraphicsLayerScope.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/HitTestResult.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InnerPlaceable.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/PointerInputDelegatingWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsWrapper.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/HitTestResultTest.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
Description
Jetpack Compose release version: 1.0.0-beta09 Android Studio Build: Bumblebee 2021.1.1 Canary 2
I have
pointerInput
modifier onBox
and it's children:The parent
pointerInput
works fine but the childrenpointerInput
only detects events inside the parent (ignores the offset). If I remove the parentpointerInput
, everything works fine.I've attached a video and sample project. In the video, the drag only works when dragged from the red part that's overlapping the blue part.