Focusing on ComponentDidMount.
See original GitHub issueWhen i do this:
componentDidMount() {
this.refs.editor.focus();
}
To put the cursor inside the box, the plugins no longer work. Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:12 (4 by maintainers)
Top Results From Across the Web
React: set focus on componentDidMount, how to do it with ...
In React, with classes I can set the focus to an input when the component loads, something like this: class Foo extends React....
Read more >How to Set Focus On Element After Rendering With React
In this guide, learn how to set focus on an element after JavaScript's React component renders it, using functional and class components.
Read more >Call a function when focused screen changes | React Navigation
In this guide we will call an action on screen focusing. This is useful for making additional API calls when a user revisits...
Read more >How to focus element in React | Tuomo Kankaanpää
To get the input autofocus when the component is rendered, we call focus() on the textInput variable in the componentDidMount() method.
Read more >How To Set Focus On Input After Render In React 16
Simple example of how to set focus on input after render in React 16. ... Inside of our componentDidMount method we're calling focus()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed this by doing a setTimeout call to focus with a zero delay.
On 15 Jul 2016 7:45 p.m., “prabodh” notifications@github.com wrote:
Yes, it does.