How can I set content paddings to a BasicTextField...
# compose
a
How can I set content paddings to a BasicTextField? If i try to apply some padding to the inner text field then the padding is not scrolled along with the text if it is too long
Wrapping into a
horizontalScroll()
inside of the inner text field does have the visual effect I want, but it doesn't scroll while I type text (which is to be expected). cant figure out how material does this
Oh, never mind. Material3 doesn't really do this. it clips the text too
Turns out it's not supported. There is a feature request at https://issuetracker.google.com/issues/302599627?ref=blog.zachklipp.com&pli=1 Also found @Zach Klippenstein (he/him) [MOD]’s article that does something similar https://blog.zachklipp.com/basictextfield-bubble-wrap I think I can work around it
🙌 2
h
r.android.com/3572469 I'll try to squeeze it into 1.9 alphas
🎉 1
🔥 2
a
@Halil Ozercan awesome. looks solid. havent looked at the dependencies yet. do u think it's something i can copy paste in my project?
z
You'd have to copy/paste
BasicTextField
, it's implemented as a modifier inside that component.
a
@Zach Klippenstein (he/him) [MOD] I am aware. what i dont have time to check right now is whether the specific overload uses compose internals. would i need to copy 1 file or a whole chunk of the framework?
z
`BasicTextField`'s implementation is spread over a few files, it would be very annoying to copy at least, assuming it doesn't use any other internal Foundation APIs (i can't remember if it does)
1
h
it will be substantially more than 1 file.
a
yeah that makes sense. thanks folks