@Romgere wrote:
Hi !
I try to achieve a simple thing : Focus an input when user entering in the route.
First I was looking for something similar to
didInsertElement
for controller, but there is nothing similar.Then I tried to use the
didTransation
of the route to call a method on a controller to focus the input, but thedidTransation
is called before the dom is ready. I can used thedidTransation
with a call tonext
(from@ember/runloop
) but it looks weird.Finally I decide to implement it with modifier on the input itself (an
auto-focus
modifier) & it works well.But I’m wonder if there is another “ember way” to allow controller to interact with dom element (aka. in the route template) for this kind of purpose ?
Thx !
Posts: 2
Participants: 2