Fixed
Status Update
Comments
ma...@wmg.com <ma...@wmg.com> #2
Lines for reference in ModalBottomSheet.android.kt
causing this behavior:
val newTarget = when (sheetState.anchoredDraggableState.targetValue) {
Hidden -> Hidden
PartiallyExpanded, Expanded -> {
val hasPartiallyExpandedState = newAnchors
.hasAnchorFor(PartiallyExpanded)
val newTarget = if (hasPartiallyExpandedState) PartiallyExpanded
else if (newAnchors.hasAnchorFor(Expanded)) Expanded else Hidden
newTarget
}
}
ma...@wmg.com <ma...@wmg.com> #3
My proposed solution would be:
val targetValue = sheetState.anchoredDraggableState.targetValue
val newTarget = when (targetValue) {
Hidden -> Hidden
PartiallyExpanded, Expanded -> {
when {
newAnchors.hasAnchorFor(targetValue)) -> targetValue
newAnchors.hasAnchorFor(PartiallyExpanded)) -> PartiallyExpanded
newAnchors.hasAnchorFor(Expanded)) -> Expanded
else -> Hidden
}
}
}
ke...@google.com <ke...@google.com>
ap...@google.com <ap...@google.com> #4
Project: chromium/src
Branch: main
commit 0fe5e3c558992a1c0b5b2aef2594049862b1c703
Author: Zach Katz <katzz@google.com>
Date: Fri May 03 23:02:15 2024
[ASH] Add fieldtrial_testing_config
Bug: 324934884
Change-Id: Ib9d0ade90999a67cd74d1b94e6ab43087b5e1ead
Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/5516358
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Commit-Queue: Zach Katz <katzz@google.com>
Cr-Commit-Position: refs/heads/main@{#1296421}
M testing/variations/fieldtrial_testing_config.json
https://chromium-review.googlesource.com/5516358
Branch: main
commit 0fe5e3c558992a1c0b5b2aef2594049862b1c703
Author: Zach Katz <katzz@google.com>
Date: Fri May 03 23:02:15 2024
[ASH] Add fieldtrial_testing_config
Bug: 324934884
Change-Id: Ib9d0ade90999a67cd74d1b94e6ab43087b5e1ead
Reviewed-on:
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Commit-Queue: Zach Katz <katzz@google.com>
Cr-Commit-Position: refs/heads/main@{#1296421}
M testing/variations/fieldtrial_testing_config.json
64...@gmail.com <64...@gmail.com> #5
any update on this? 😅
tj...@fieldwire.com <tj...@fieldwire.com> #6
any updates?
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
Author: Jose Figueroa <
Link:
[M3][BottomSheets] Update Expanded target to remain expanded on resize.
Expand for full commit details
[M3][BottomSheets] Update Expanded target to remain expanded on resize.
Expanded anchor is always defined.
Bug: 324934884
Test: Add Expanded check to anchor testing
RelNote: "Expanded bottom sheet remains expanded on size change."
Change-Id: I2870ba38420d18b02676e6f280ef96dddc6a3a8a
Files:
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ModalBottomSheetTest.kt
- M
compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ModalBottomSheet.kt
Hash: 0a8673ffe397d5cfe341fa60a281212388c3f1e0
Date: Fri Nov 08 16:59:04 2024
se...@google.com <se...@google.com>
le...@gmail.com <le...@gmail.com> #8
version 1.4.0-alpha05
not fixed
not fixed
ri...@td.com <ri...@td.com> #9
This behavior is pretty frustrating for our users, can we port this backwards to a stable version instead of an alpha version? I'd rather not consume an alpha version and ship it to production.
Description
Jetpack Compose version: 1.5.9 Jetpack Compose component used: BottomModalSheet Android Studio Build: Hedgehog 2023.1.1 Patch 2 Kotlin version: 1.9.22
Steps to Reproduce or Code Sample to Reproduce:
We have a
ModalBottomSheet
with a stickyTextField
on the bottom. We allow bothPartiallyExpanded
andExpanded
states. Whenever we are in theExpanded
state and focus on theTextField
, the resulting screen resize from the keyboard showing causes theModalBottomSheet
to switch its target state toPartiallyExpanded
.This is a pretty jarring UI experience and ideally we would just stay in the
Expanded
state.I've traced it down to these lines in
ModalBottomSheet.android.kt
that prioritizePartiallyExpanded
whenever the anchors change (via the screen size changing).Here is a sample project and video is included: