material-bread
material-bread copied to clipboard
TextField focused prop display only?
Describe the bug No possible way to apply focus to input. I suggest either maintaining a ref that gets passed to the TextInput or allowing users to pass their own ref into TextField.
To Reproduce Steps to reproduce the behavior: When clicking a button and changing the focused prop on a TextField from false to true, it is only displayed as focused but when I start typing the browser's focus and mobile focus is still on the button.
Expected behavior Focused prop actually focuses the input and using a ref.

For refs, we are spreading the all additional props onto the TextInput element, that should allow for a custom ref.
I agree toggling focused should automatically call .focus()
Thanks!
I just hit this too - I don't think refs get forwarded in the same way as other props, at least using something like:
<TextField
ref={r => this.thing = r}
/>
in React Native gives the error thing.focus() is not a function. see https://reactjs.org/docs/forwarding-refs.html
I also just hit this. Is there a workaround for this? I can't focus the second input using onSubmitEditing on the first to reference the second...
I have just hit this too guys. I agree with @bcgilliom, they are not forwarded the same way as othe props.
Any eta on getting a fix for this?
I also have the "focus() is not a function" issue, can anyone help? I am very need it on my work.