CaioQuirinoMedeiros / react-native-mask-input

🎭:iphone: A simple and effective Text Input with mask for ReactNative on iOS and Android. Includes obfuscation characters feature.
https://www.npmjs.com/package/react-native-mask-input
MIT License
309 stars 31 forks source link

Focus on an input #17

Closed dlaynes-gl closed 2 years ago

dlaynes-gl commented 2 years ago

Hi. I'd like to use ref.focus() on the inner TextInput element. Is it possible? Thank you

CaioQuirinoMedeiros commented 2 years ago

Yes, just like a normal TextInput

dlaynes-gl commented 2 years ago

I'll try again soon with a typescript reference annotation with TextInput and not MaskInput and will post the results.

dlaynes-gl commented 2 years ago

This works properly in Typescript (forwardRef, useImperativeHandle). Thanks

const inputRef = createRef< TextInput >()