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

Jorge Rodríguez

12/14/2023, 10:43 PM
I have a question related to
TextField
. How can I open a hyperlink instead of the keyboard?
z

Zach Klippenstein (he/him) [MOD]

12/14/2023, 11:34 PM
Please elaborate. When/under what conditions do you want to open the hyperlink?
j

Jorge Rodríguez

12/14/2023, 11:36 PM
When I’m editing a text with styles I have a text with a link but instead of opening the keyboard I want to open the hyperlink. Is that possible ?
z

Zach Klippenstein (he/him) [MOD]

12/14/2023, 11:43 PM
first of all, TextField doesn’t support editing text with styles at all right now, so i’m curious how you’re doing that.
But yea, you can use the same technique as
ClickableText
– use
onTextLayoutResult
and a click handler to detect the click
👍 1
Then use
UriHandler
to open the URL
j

Jorge Rodríguez

12/14/2023, 11:44 PM
I’m working with a custom Textfield that keeps the styles
z

Zach Klippenstein (he/him) [MOD]

12/14/2023, 11:44 PM
We’re working on proper hyperlink support right now, but it won’t come to text fields until next year
j

Jorge Rodríguez

12/14/2023, 11:44 PM
Thanks @Zach Klippenstein (he/him) [MOD] for the advice
Maybe for the BTF2 ?
z

Zach Klippenstein (he/him) [MOD]

12/14/2023, 11:45 PM
yes it will only be BTF2
j

Jorge Rodríguez

12/14/2023, 11:46 PM
Just one more question . Do you have plans for BTF2 to support multi styles ?
z

Zach Klippenstein (he/him) [MOD]

12/14/2023, 11:56 PM
Yes. Styles would likely be a pre-requisite for supporting links.