question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 6 years ago
  • Reactions:17
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
kucebcommented, Jun 29, 2018

I’m currently working on this. An upcoming patch release should fix this issue - this should be true for many cy.type related bugs

2reactions
paulbaocommented, May 2, 2018

There’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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found