I have 2 questions... using compose web how can I set focus on a given input? ... when I could use the DOM, for example: document.getElementById("inQtd"), I put it in several places in my font and it doesn't recover anything.
Grateful
b
Big Chungus
09/21/2022, 10:06 PM
You could register DisposableEffect which gives you access to nativeElement. Same applies to attrs.ref if you only need to do it on creation.
Big Chungus
09/21/2022, 10:08 PM
Likewise you could run getElementById inside SideEffect, which runs after dom insertion I believe
e
Eduardo Zuza
09/23/2022, 8:49 PM
Copy code
Thank you very much, I can access the screen components this way, as you said.
if (_inProduto.text().equals("")) {
SideEffect {
(document.getElementById("_inProduto") as HTMLInputElement).focus()
}
}