Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Description:
TextFields that use the
TextFieldState
API within a composable passed to thedetailPane
parameter of aListDetailPaneScaffold
are not updated when selecting different items in thelistPane
.The issue occurs after opening a
ListDetailPaneScaffold
and selecting an item for the first time: until then everything behaves as expected. However, when selecting a different item from the list, the content of the TextFields that use theTextFieldState
API does not update and remains with the data of the at first selected item.How to Reproduce:
group = "androidx.compose.material3.adaptive"
,name = "adaptive-navigation"
,version = "1.0.0"
ListDetailPaneScaffold
as described in the official Jetpack Compose documentation:MyDetails(item: MyItem)
implementation as follows:with
Why I Reported This:
I initially interpreted the
detailPane
implementation in the example codelike this: I assumed that every time a list item is clicked,
MyDetails
would be recreated with the correspondingMyItem
object as a parameter, and that this would trigger a recomposition and update the content of the TextField.In Case This Behavior Is Intended:
If this behavior is intentional, I strongly recommend adding a note about how TextFields behave within a
ListDetailPaneScaffold
to the documentation. This behavior, while it might be logically based on Compose's internal principles, can be very confusing. I could not find any mention of this behavior or any guidance in the design guidelines regarding the use of TextFields within aListDetailPaneScaffold
.