thevsstech / react-native-masked-input

A pure javascript masked text and input text component for React-Native.
MIT License
13 stars 2 forks source link

`const textInput = this.zipCodeField.getElement()` won't work #2

Open EQuimper opened 3 years ago

EQuimper commented 3 years ago

Because the getElement is a getter here https://github.com/thevsstech/react-native-masked-input/blob/master/src/text-input-mask.tsx#L39 . So this should be const textInput = this.zipCodeField.getElement but also it's a RefObject. So this is more const textInput = this.zipCodeField.getElement.current Are you open to pr ?

kerrpeter commented 1 year ago

Also noticed the above. I was trying to set focus programaticaly Which I can do with

  <TextInputMask
            ref={(ref) => (moneyRef = ref)}
            ...
  />

 moneyRef.getElement.current.focus()

But I noticed there is refInput property. WHat is that used for, Perhaps that should allowing referencing the input directly without having to use getElement getter property