In compose-html, one can grab the scope element of...
# compose-web
a
In compose-html, one can grab the scope element of a Div like so
Copy code
Div {
  DisposableEffect {
    val el = scopeElement
    onDispose { }
  }
}
How does one grab the scope element of an
Input
, as the
DisposableEffect
is only accessible in the content of a
TagElement
?? Use Case. I need to get a reference of a hidden file input element and the compose-html api currently doesn't give me an idiomatic way to grab the reference of the input I know I can create an
Id
for the element, but it gets tricky when the composable is meant to be rendered multiple times in the same page
d
Copy code
Input(InputType.Text, attrs = {
    ref { element ->
        onDispose {  }
    }
})
a
Thanks a lot David.
d
No problem!