FaridSafi / react-native-gifted-form

📝 « One React-Native form component to rule them all »
MIT License
1.44k stars 214 forks source link

react-native-stateless-form is out #29

Open danielweinmann opened 8 years ago

danielweinmann commented 8 years ago

Hey @FaridSafi! Last night I couldn't bare struggling with scroll/focus problems and having to deal with state/validation logic while fixing things. So I created https://github.com/danielweinmann/react-native-stateless-form ;)

It is supposed to be a different implementation of your work, and since you said that in a next big version you wanted to have the GiftedForm stateless, I think we could collaborate to integrate the two projects. StatelessForm already has 3 major differences from GiftedForm, apart of being stateless:

  1. It implements scroll based on widget position, so it works much better IMO.
  2. It implements auto-focus on next inputs and returnKeyType accordingly.
  3. It is aware of keyboard state, so it is easy to implement new things with this in mind.

All 3 things work on iOS only, for now. But my next move will be to try and make it work on Android.

For now, I only implemented InlineTextInput widget, which is a simplified copy of TextInputWidget. But I'd really like to have all your great widgets ported as well ;) every time I need one of them I'll do it ;)

What do you say?

FaridSafi commented 8 years ago

Impressive! Features 1/2/3 are very good. Currently I'm working on a react web project so I don't have so much time, but in few weeks I will take a closer look

danielweinmann commented 8 years ago

Great! Let me know if you think anything could be implemented differently ;)

Right now it is working perfectly both on iOS and Android. But I removed feature 3 since keyboard events don't work when we set android:windowSoftInputMode="adjustNothing" on AndroidManifest.xml.

It also made more sense to always scroll to the input on focus, and always scroll back to top on blur, independently of keyboard state.