Skip to content

Integer not accepted as keyboardType in TextField #8248

Closed

Description

@Noppey

Environment

  • CLI:
  • Android Runtime: 6.3.0
  • iOS Runtime: 6.3.0
  • Plugin(s): -

Describe the bug
TextField with keyboardType="integer" crashes the application.

To Reproduce
Create TextField with keyboardType="integer"

Expected behavior
Keyboard without ability to add decimals

Sample project
https://play.nativescript.org/?template=play-ng&id=FlqpWD

Activity

  1. NickIliev commented on Jan 15, 2020

    @NickIliev
    Contributor

    @Noppey the integer option is added in the master branch (of @nativescript/core a.k.a. tns-core-modules) and the Playground is using the latest official version of the modules. So this is the reason why the Playground is failing. At this very moment, you could use the integer option by installing the next of the modules in a locally created project.

    tns create myapp --tsc
    npm i tns-core-modules@next --save-dev
    

    This feature will be published officially with version 6.4.0 of the modules.

  2. Noppey commented on Jan 15, 2020

    @Noppey
    Author

    Ran this line in my own project:
    npm i tns-core-modules@next --save-dev

    In package.json I now have devDependencies:
    "tns-core-modules": "^6.3.0-next-2020-01-14-155346-03"

    But I still get the same exception, using my Android device (Samsung S8)

  3. NickIliev commented on Jan 15, 2020

    @NickIliev
    Contributor

    @Noppey the project is using the scoped packages. So in your case you need to update both the scoped package (@nativescript/core) and the compat package (tns-core-modules)

    npm i @nativescriprt/core@next --save
    npm i tns-core-modules@next --save
    
    rm -rf platforms
    tns run
    
  4. Noppey commented on Jan 15, 2020

    @Noppey
    Author

    Ok that kind of works, but now it shows the input text as hidden (dots), as what I would expect in case of type="password".

  5. Noppey commented on Jan 15, 2020

    @Noppey
    Author

    So on iOS it works fine, but on Android it's presented as a password field (dots)

  6. NickIliev commented on Jan 15, 2020

    @NickIliev
    Contributor

    @Noppey thanks for reporting this one! I will post a PR fixing this bug.

  7. Noppey commented on Jan 16, 2020

    @Noppey
    Author

    I've updated to "tns-core-modules": "^6.3.0-next-2020-01-16-110603-01", but the problem is still there.

    I thought the @next would be the current master version, and since this is merged I expected it to work.

    Is there another step that I have to wait for before I can test this functionality?

  8. Noppey commented on Jan 27, 2020

    @Noppey
    Author

    What steps are required before I can start using this functionality including the password-bugfix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions