Skip to content

Conversation

@vslinko
Copy link
Contributor

@vslinko vslinko commented May 20, 2016

No description provided.

@vslinko vslinko changed the title Proxy focus and blur methos Proxy focus and blur methods May 20, 2016
@iamdustan
Copy link
Collaborator

Could you describe what this accomplishes and the motivation?

},

focus() {
this.input.focus();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should any arguments like the event object be passed through?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I know HTMLInputElement.focus has no arguments.

@vslinko
Copy link
Contributor Author

vslinko commented May 20, 2016

I have some cases when I should focus or blur manually, from a parent component.

@iamdustan
Copy link
Collaborator

ah. so this is to get a ref to the maskedinput so you can do something like:

componentWillMount() {
  this.mask && this.mask.focus()
}
render () {
  return <MaskedInput ref={comp = this.mask = comp{ />
}

and the MaskedInput will behave as though it was a standard form input?

@vslinko
Copy link
Contributor Author

vslinko commented May 20, 2016

Yes, you're right.

@iamdustan
Copy link
Collaborator

👍 thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants