react-native-autofocus icon indicating copy to clipboard operation
react-native-autofocus copied to clipboard

added lots of stuff

Open corupta opened this issue 6 years ago • 3 comments

now, the module can be used with elements other than text input too, also there's no need to import text input from this module anymore

corupta avatar Mar 03 '18 14:03 corupta

missing readme tho

corupta avatar Mar 03 '18 14:03 corupta

What's the need for this, could you elaborate in the readme?

zackify avatar Mar 05 '18 20:03 zackify

Hi, sorry for late reply. I loved your idea of the auto focus form and extended it to a general module that can use not only textinput but also with any other custom modules such as pickers and input element from react native elements, and etc.

I did a silly pull request though, and shared it before testing.

My idea was to why not use this for any component that implemets focus and onSubmit functionality.

And later by implementing focus and onsubmit functionality for the autofocus form component, those form components can be used in a nested behavior, too.

For example,

SomeComponent =
   <Form>
     <TextInput />
     <TextInput />
   </Form>

Then,

App =
<Form>
  <SomeComponent />
  <SomeComponent />
</Form>

Too, has the auto focus function everywhere. It needs a good readme, and more testing, but it does work. However, right now I'm getting big performance issues when re-rendering everything the children gets to be recloned and their autofocus functionality gets recalculated.

Thus, I have decided to quit this implementation for a while. You can close the pull request. I may in the future re-implement this module in some new way. But not anytime sooner.

Have a nice day!

corupta avatar Mar 30 '18 19:03 corupta