Is there a way to make a `Text` that has a clickab...
# compose-desktop
e
Is there a way to make a
Text
that has a clickable modifier not be focusable?
a
Try
Copy code
Modifier.focusProperties{ canFocus = false }
e
That didn't work (neither did
focusable(false)
or using both together)
a
The
focusProperties
need to come first. This works for me:
Copy code
fun main() = singleWindowApplication {
    var text by remember { mutableStateOf("") }
    Column {
        TextField(text, { text = it })
        Text(
            text = "Hello",
            modifier = Modifier
                .focusProperties {
                    canFocus = false
                }
                .clickable {
                    println("Clicked")
                }
        )
    }
}
e
Putting them first worked. Thanks!
a
I know this is compose, not compose desktop related, but the fact that order can subtly and silently break things like this feels like a big weakness of the framework
a
It’s a feature, not a bug. Modifier order matters.
Modifier.padding().border()
is not the same as
Modifier.border().padding()
But I agree that sometimes it’s unexpected
a
ah I can see that, suppose I just need to get more familiar with it