bigardone / phoenix-trello

Trello tribute done in Elixir, Phoenix Framework, React and Redux.
https://phoenix-trello.herokuapp.com
MIT License
2.5k stars 407 forks source link

focus input for "add card" form / "add board" form #3

Closed mindreframer closed 8 years ago

mindreframer commented 8 years ago

problem:

solution:

bigardone commented 8 years ago

Hi! Thanks for the PR :)

As I'm using the latest React version is not permitted to access the .getDOMNode() function from the refs...

https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html#dom-node-refs

Instead we can use:

  componentDidMount() {
    this.refs.name.focus();
  }

If you change both I can merge the PR. Thanks again :)

mindreframer commented 8 years ago

thanks for telling, I missed that one ;) cheers !

bigardone commented 8 years ago

Thanks to you! Merging! :+1: