I wish we could tell `@Preview` that a composable ...
# compose
s
I wish we could tell
@Preview
that a composable should be shown in its focused (or pressed, or hovered) state. Where is the right place to file a feature request for that?
s
You can pass in your own MutableInteractionState and make that focused or something like that, then pass that into the right parameter of your composable
1
s
s
Yup, I can see in our code we have some instances like this:
Copy code
remember {
  object : MutableInteractionSource {
    override val interactions: Flow<Interaction>
      get() = flowOf(FocusInteraction.Focus())

    override suspend fun emit(interaction: Interaction) {
    }

    override fun tryEmit(interaction: Interaction): Boolean {
      return false
    }
  }
}
or
Copy code
remember {
  object : MutableInteractionSource {
    override val interactions: Flow<Interaction>
      get() = flowOf(HoverInteraction.Enter())

    override suspend fun emit(interaction: Interaction) {
    }

    override fun tryEmit(interaction: Interaction): Boolean {
      return false
    }
  }
}
precisely for some previews
👍 1