Fixed
Status Update
Comments
ke...@google.com <ke...@google.com>
ma...@google.com <ma...@google.com>
pr...@google.com <pr...@google.com> #4
The release notes documentation has been edited to clarify this change in behavior for line height.
To support non-standard text sizes, we encourage users to follow the Material design system and use a different style = LocalTextStyle.current.copy(lineHeight = TextUnit.Unspecified)
, or create a custom Typography
entirely.
Description
Jetpack Compose version: BOM 2024.06.00
Material Library Version (M2, M3 or Both?): M3
Material Compose component used: SearchBar
Android Studio Build: 2024.1.1
Kotlin version: 2.0.0
Steps to Reproduce or Code Sample to Reproduce:
SearchBar
astopBar
and aLazyColumn
of items ascontent
into aScaffold
.SearchBar
.SearchBar
pushes content below away instead of overlaying above it, and closing it pulls back the content below.SearchBar
increasing its layout height in-place, which means thecontent
will be given less height during measurement.This can be seen in blog posts about how to usehttps://medium.com/@shivathapaa/custom-topappbar-using-android-jetpack-compose-f9b33388a125 (disclaimer: I'm not the author of it) has a GIF recording which shows this problem if one observe carefully.
SearchBar
as well, e.g.This isn't a problem in Compose Material Catalog SearchBarSamples because the sample is using a
Box
and a fixed top padding for the list. However, that doesn't work in most real world scenarios e.g. when people need to useScaffold
.I think the material-components-android approach for , which is to offer
SearchBar
SearchBar
andSearchView
separately, is more flexible and will make it possible to handle layout (and window insets) correctly under all scenarios.Stack trace (if applicable): N/A