I鈥檓 able to set focus for a normal TextInput component, but not for a TextInput.PasswordInput component.
Test code:
// this works
<TextInput
ref={input => input && input.focus && input.focus()}
type="text"
labelText="Username"
...
/>
// this doesn't work
<TextInput.PasswordInput
ref={input => input && input.focus && input.focus()}
labelText="Password"
...
/>
The ref for TextInput.PasswordInput isn鈥檛 working as I see this warning:
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
A PasswordInput should have the same functionality as a TextInput.
@emyarod I checked this and found the ref forwarding is not applied to PasswordInput function. Are you working on this? If not I am very much interested in working on this.
@code-blooded-developer thanks, I was going to take a look near the end of the day but you can go ahead and open a PR
Thanks for fixing this! Is there a release date planned for this?
@queeniema should be available in the next patch release (usually about a week between them)