Skip to content

Writing numbers with a "dot" as decimal point using input type="Number" clears the input #5983

Description

@veith

Bug Description

While entering a decimal number using a "dot" as a separator the input field gets empty in chrome and in safari it triggers a
InvalidStateError The input element's type ('number') does not support selection.

This makes the Input element useless for countries which uses the "dot" as separator.

Expected Behavior

Allow entering numbers with dot as a decimal point, like in 1.7.1 and before

Steps to Reproduce

  1. Set your browser to a locale which uses "dot" as decimal point like Switzerland, or one of this list
  2. Enter a digit followed by a "dot"

Isolated Example

CodeSandbox

Context

  • UI5 Web Components version: 1.8.0
  • OS/Platform: MacOs
  • Browser: Chrome, Safari
  • Affected component: Input

Priority

  • Low
  • Medium
  • High
  • Very High

Note: As a user you can use a comma to enter a number, but this feels "strange"

Activity

  1. TeodorTaushanov commented on Oct 31, 2022

    @TeodorTaushanov
    Member

    Hi @veith,

    This look like browser native language specific behavior.

    How does the standard HTML input element work at your computer:
    https://codesandbox.io/s/ui5-webcomponents-forked-jb7jxi

    Best,
    Teo

  2. veith commented on Nov 1, 2022

    @veith
    Author

    The native input elements are working as expected.

  3. veith commented on Nov 2, 2022

    @veith
    Author

    UI5 versions <= 1.7.1 are also working as expected.

  4. veith commented on Nov 2, 2022

    @veith
    Author

    On Android the keyboard only allow to enter "Number" types only with ..
    It is not possible to enter a decimal number on tablets with ui5 >= 1.8.0 having a swiss local.

    IMG_20221102_070708

  5. veith commented on Nov 2, 2022

    @veith
    Author

    UI5 had this problem before,

    #1675

  6. added 2 commits that reference this issue on Nov 3, 2022
    99c89e1
    cc1eea6
  7. maltenorstroem commented on Nov 15, 2022

    @maltenorstroem

    Hi all,
    I can see the same behaviour on a Google Pixel 6, Android 13 with Chrome 107.0.5304.105.
    It is not possible to enter decimal places with a dot (German/Swiss keyboard layout). The field is emptied when the decimal point is entered. (Comma as decimal "point" works)
    Screenshot_20221115-152347

  8. added a commit that references this issue on Nov 15, 2022
    2096497
  9. MarcOmlin commented on Nov 17, 2022

    @MarcOmlin

    Hi all,

    I can see the same behaviour and reproduced this error on my Mac.

    OS:
    macOS Big Sur Version 11.6.8
    MacBook Pro (Retina, 15-inch, Mid 2014)
    TEST_0_OS

    Google-Chrome Version:
    Google Chrome
    Chrome ist auf dem neuesten Stand
    Version 107.0.5304.110 (Offizieller Build) (x86_64)
    TEST_ENDECH_Chrome_Version

    Test-Case (EN) OS-Language set to English:

    TEST_EN_0: Open url: https://codesandbox.io/s/ui5-webcomponents-forked-biwthg?file=/src/index.js
    TEST_EN_0

    TEST_EN_1: Type 1
    TEST_EN_1

    TEST_EN_1Dot: after 1 was Typed Type a . (Dot) --> No Issue 1. is still in the inputbox.
    TEST_EN_1Dot

    Test-Case (DECH) OS-Language set to Detusch (Deutsch (Schweiz)):

    TEST_DECH_0: Open url: https://codesandbox.io/s/ui5-webcomponents-forked-biwthg?file=/src/index.js
    Here what u can see the default representation of 1.5 defined in the second input-box is 1,5 on the screen.
    <ui5-input type="Number" value="1.5"></ui5-input>
    TEST_DECH_0

    TEST_DECH_1: Type 1
    TEST_DECH_1

    TEST_DECH_1Dot: after 1 was Typed Type a . (Dot) --> Issue appears here now u can see the input box is cleard instantly.
    TEST_DECH_1Dot

    As far as i can say. The language in google-chrome had no inpact on this issue.
    But when i changed the system Language then this issue appeard.

    Hope this helps you to recreate the issue.

  10. TeodorTaushanov commented on Nov 17, 2022

    @TeodorTaushanov
    Member

    Hello @SAP/ui5-webcomponents-topic-rl, please check the suggested fix for this issue.

  11. added a commit that references this issue on Nov 21, 2022
  12. 6 remaining items

  13. DMihaylova commented on Aug 31, 2026

    @DMihaylova

    Hi @veith,

    We have good news - you can now find the new experimental Number Input component with localized decimal separator here: https://ui5.github.io/webcomponents/nightly/components/main/NumberInput/

    Could you please test it regarding your use case?

    Done via this PR: #13799

    Regards,
    Diana

  14. moved this from Completed to In progress in Maintenance - Topic RLon Aug 31, 2026
  15. moved this from New Issues to Completed in Maintenance - Topic Bon Sep 8, 2026
  16. github-actions commented on Sep 8, 2026

    @github-actions

    This issue has been closed. To reopen, just leave a comment!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    TOPIC BbugThis issue is a bug in the code

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions