https://kotlinlang.org logo
#compose
Title
# compose
j

Joseph Hawkes-Cates

07/14/2022, 8:08 PM
I’d like to create a text field that opens up a DatePicker when it’s selected. Would it be best to use the TextField composable and then customize the InteractionSource to show my date picker instead of the keyboard or would it be better to just create my own “field” composable which has it’s own onClick impl?
If I add a clickable modifier to my TextField, does that override the default click behavior?
d

dewildte

07/14/2022, 9:45 PM
I think so, also you could use the readOnly flag?
c

Colton Idle

07/14/2022, 11:54 PM
I did something like this and yeah I basically use readOnly or enabled = false and clickable. Or some general mix of those. I vaguely remember that maybe the touch ripple didn't work as I wanted it (it didn't clip to my outlinedTextField, and so I may have wrapped the entire thing in a Box and set the clickable there.
🙌 1
8 Views