How to set focus on input field in react?

Posted by Prem Tiwari | Updated on

Want to set focus on input field in react? Define a directive and have it $watch a property/trigger so it knows when to focus the element:

Here is live demo: http://plnkr.co/edit/V8PSie?p=preview


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers