How to set focus on an element in Elm?

前端 未结 5 1501
暗喜
暗喜 2020-12-14 00:32

How can I set the focus on a Html element in Elm? I tried to set the autofocus attribute on the element and it only sets the focus on the page load.

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 00:44

    With elm/html 0.19 you can set the Html.Attrbutes autofocus to True

    input [ onInput Code, autofocus True ] []
    

提交回复
热议问题