gcanti / tcomb-form-native

Forms library for react-native
MIT License
3.14k stars 458 forks source link

German / European numeric input field error #310

Closed lockeyo closed 7 years ago

lockeyo commented 7 years ago

Version

Tell us which versions you are using:

Expected behaviour

I am using a german iPhone 7 with a german number pad. I want to use a number input field. If I type in a number with a comma e.g. 2,73 the number is detected as mistake and masked as an error. In Germany we don't separate by a dot.

Actual behaviour

I would want that I can write a comma or dot in the numbers input field. Could you make that possible?

Steps to reproduce

  1. Select German type pad in your systems OS
  2. Build a form and open that form on your device
  3. Click in the form and try to send it without an error.

Stack trace and console log

There is no stack trace needed.

gcanti commented 7 years ago

You can define a custom transformer, see here https://github.com/gcanti/tcomb-form-native#transformers and here https://github.com/gcanti/tcomb-form-native/blob/master/lib/components.js#L215

alvaromb commented 7 years ago

Closing. @lockeyo ping us if you need further help!