I have 2 questions... using compose web how can I ...
# compose-web
e
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
You could register DisposableEffect which gives you access to nativeElement. Same applies to attrs.ref if you only need to do it on creation.
Likewise you could run getElementById inside SideEffect, which runs after dom insertion I believe
e
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()                    
    }
}
b
You lost me mate, what's the question here then?