Digits Scrambled when using type on tel input field with input mask
See original GitHub issue- Operating System: Windows 10
- Cypress Version: 1.1.0
- Browser Version: Chrome
Is this a Feature or Bug?
Bug
Current behavior:
When using .type() on tel inputs with masks, the numbers are entered out of order. That is, digits are added to the end of the field when they meet a special character.
Desired behavior:
The digits are entered into the field in order.
How to reproduce:
Call .type() on a tel input field with an input mask that provides hyphens, parentheses, or other formatting
Test code:
cy.get("#PrimaryPhone").type("1234567890").should('have.value', "(123) 456-7890")
//The above expected output is based on the input mask used by my application.
//Your mileage may vary.
Additional Info (images, stack traces, etc)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:17
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Control data entry formats with input masks - Microsoft Support
In the Input Mask text box enter characters and placeholders using the allowed characters from the table list. Click the Mask Type down...
Read more >Mask for an Input to allow phone numbers? - angular
Just enter numbers until you reach 10 digits, and the mask will present 111/111-1111. Try to enter an 11th digit, you'll see the...
Read more >How to Use an Input Mask in Microsoft Access ... - YouTube
We will create input masks for telephone numbers, ZIP cod... ... (A Gold Member) asks: The phone number field in my database is...
Read more >How to setup phone input field masks for your region/country
To add your own mask format for your country, go to Forms>Settings>Customize Fields. You can edit an existing field or create new ones....
Read more >unscramble verify
EDD Telephone Numbers: Website: Edd. All art by Scrambled Channel Games portrays ... your scrambled letters you wish to unscramble in the first...
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 Free
Top 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
I’m currently working on this. An upcoming patch release should fix this issue - this should be true for many
cy.type
related bugsThere’s workaround that might be helpful to people who have the same issue.
cy.get("#PrimaryPhone").then($input => $input.val('(123) 456-7890')).should('have.value', "(123) 456-7890")
update
It seems that this won’t actually change the input value when it lost focus. I’ve tried sth like
$input.attr('value', '(123) 456-7890')
but not working for me.