`.type()` does not visually display commas in `input type=number` when locale normally displays commas
See original GitHub issueOccurrence: browser with polish language setting (change to reproduce) because input behavior depends on your location/lang settings
Current behavior:
cy.type skips the coma in decimals on input type=number when typing
When I try to type eg. 2,99
on input cypress types 299
(without coma).
It works with . (dot).
Desired behavior:
cy.type
types correct decimal values eg. 2,99; 9,99; 100,9;
(with comas)
Test code to reproduce
Reproduce on any number input form, but change to eg. polish language of browser (or other uses coma as separator in decimal number format)
it('Test INPUT NUMBER issue', function () {
cy.viewport(800, 600);
cy.visit('http://maniax.pl/input-number.html');
cy.get('[type="number"]').type('9,99').type('{enter}');
});
Versions
Cypress since 4.8.0 to 4.11.0 latest Chrome, Chromium, Edge Windows 10 x64 NPM 6.14.5 Enviroment/locale: Polish Language of webbrowser: polish
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Why ionic ion-input type="number" does not allow comma in ...
When i build the app in ios (Iphone 14, ios 16) the keyboard shows a comma , but when i input a value...
Read more ><input type="email"> - HTML: HyperText Markup Language
The input is now considered valid when a single email address is entered, or when any number of email addresses separated by commas...
Read more >Import or export text (.txt or .csv) files - Microsoft Support
To export data from Excel to a text file, use the Save As command and change the file type from the drop-down menu....
Read more >Adding custom formatting to numeric fields | Looker
Excel-style formatting does not support many international number formats, ... Dollars with 2 decimals, positive values displayed normally, ...
Read more >Comma Style in Excel | How to Apply? | Shortcut Keys to Use
The comma style is a formatting style used in visualizing numbers with commas when the values are over 1000. Such as, if we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have the same issue and I think this bug is underrated and much more serious. Cause while typing in a german locale (where , is the fraction deparator and . is the thousands separator) its not send to the field cause Cypress thinks its invalid as number. But in our locale its perfectly fine. Its not only a visual bug, it makes our numeric inputs not working at all when it is floating point number.
If native events really fix it and take time until released there should be a workaround in cypress or a bugfix release that is fixing the issue in keyboard.js.
Hopefully I got this right.
Still facing this issue.