jwohlfert23 / react-native-tag-input

A simple React Native component that creates an input for tags, emails, etc.
MIT License
233 stars 105 forks source link

added blur and scrollToTop methods #50

Closed ou2s closed 6 years ago

ou2s commented 6 years ago

I needed to add ScrollToTop in order to resolve the bug shown here: https://wetransfer.com/downloads/b1a574a6cba5556eb3d509e0fc9d273420171211114913/f5de232efb03cee87afcc701ce39a8d920171211114913/8fcd45

As you can see the caret was on top of the scrollview and therefore hidden since the scrollview was not on its top.

Also, autoFocus was not good for me because when using React Navigation, this causes a frame drop. So I had to delay the focus when entering the screen, but also make sure to blur the textInput before leaving the screen. I tried to get textInput ref in the begining, but this was causing another bug because since both my component and TagInput were trying to retrieve the same ref, only one component can retrieve the ref, causing TagInput to have a null ref for TextInput. So my only solution was to implement scrollToTop.

Ashoat commented 6 years ago

Ping!

ou2s commented 6 years ago

I'm sorry @Ashoat completely forgot about this PR. Will have a look at it ASAP.

Ashoat commented 6 years ago

(Feel free to reopen, just doing some housekeeping.)