Material has regular input fields and condensed input fields. How do we use condensed text input in ...
c
Material has regular input fields and condensed input fields. How do we use condensed text input in compose material?
s
what is condensed text input? https://material.io/components/text-fields
cant see it
o
@Siyamed I'm guessing it's about the section called "Dense Text Fields" on the page you linked - it's a subsection of both Filled and Outlined.
c
Sorry. Yes. Dense not condensed
c
Unfortunately I don’t think we implemented denser versions of the input fields in the Material library. I thought for a second that changing the fontSize (content size) would change things but I was wrong:
Digging deeper, I can see why since we are setting the height and width based on some internal constants on
BasicTextField
What I’ve done so far is “reimplement” it with
BasicTextField
to get the denser sizes. But then you lose some of the Material functionality from the spec like the moving placeholder label and the animations.
Overall, we have discussed how to approach reducing density with Material components at a theme level since there will be scenarios in the future where Compose will be used in a mouse/keyboard context where selection targets can be below the recommended Material touch target size of 44.dp (e.g. 24.dp). But I don’t think we’ll land a solution by stable. Others on the team might know more.
c
Ah. Dang. Okay yeah would be nice to know. Overall I know it's hard for compose material team to be able to have a timeline but knowing if something will be available or not via some roadmap for stable would be helpful for us to know whether we should spend time reimplementing certain components. Thanks for checking though
c
knowing if something will be available or not via some roadmap for stable would be helpful for us to know
💯 I think this is something we are looking to be more transparent about soon
1
💯 1