Skip to content

KeyboardType does not work the same way as in React Native #1705

@RichardLindhout

Description

@RichardLindhout

The problem
I want a date mask in the form of DD/MM/YYYY with a numeric input on the web.
Schermafbeelding 2020-08-15 om 14 37 22

When I fill in 21 my mask function makes it 21/ because of the format but the textinput can't parse because it is not a numeric value anymore.

Schermafbeelding 2020-08-15 om 14 31 24

Code

<TextInputWithMask
      value={formattedValue}
      keyboardType={'numeric'}
      placeholder={inputFormat}
    />

How to reproduce

Expected behavior

Use the inputmode for the keyboardType instead of editing the type itself to be more like React Native
https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.13.7
  • React (version): not relevant
  • Browser: Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions