how react programmatically focus input

前端 未结 6 2097
滥情空心
滥情空心 2020-12-15 03:01

I\'m trying to implement a very simple use case, a UI feature, where:

  1. There is a label with some content in it
  2. If clicked, a text input replaces it wi
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-15 03:52

    Just add autofocus attribute to the input. (of course in JSX it is autoFocus)

提交回复
热议问题