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.

Each character repeats on Mobile

See original GitHub issue

Hi. I’m running these masks:

$("div.phone_us input").inputmask({mask:"(999) 999-9999", "clearIncomplete":true}); $("div.height input").inputmask({mask:"9'9[9]\"", greedy:false, "clearIncomplete":true}); $("div.weight input").inputmask({mask:"99[9]lbs", greedy:false, "clearIncomplete":true});

On Android Mobile (not tested on iPhone), the following bug occurs:

Type any digit (e.g., 2), the digit is added twice. Hit backspace to delete the repetition, type the next digit (e.g., 6), that digit is added twice.

And so on.

It also does not allow you to enter the same digit three times in a row on mobile. On desktop it is fine.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
afattahi54commented, May 18, 2015

I have same issue as mentioned https://github.com/RobinHerbots/jquery.inputmask/issues/898 https://github.com/RobinHerbots/jquery.inputmask/issues/897 For now on i just disabled them, this function may help

function isDeviceSmartPhone(){      
    if ((/iP(od|hone)/i.test(window.navigator.userAgent)) || 
         (/Android/i.test(window.navigator.userAgent) )) {
        return  true;
    }else{      
        return false ;      
   }   
} 

and change inputmask function as below

    (function(){
    // Store a reference to the original remove method.
    var originalInputmaskMethod = jQuery.fn.inputmask;    
    // Define overriding method.
    jQuery.fn.inputmask = function(){
    //if this is an smart device do not add inputmask
        if (isDeviceSmartPhone()){
               return;
          }else{
               originalInputmaskMethod.apply( this, arguments );
          }
        }
     })();
0reactions
RobinHerbotscommented, Jan 26, 2016

@afattahi54 , @nfort ,

The latest version does accept the input. Tested in android chrome browser.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Repeating characters on Android Chrome · Issue #421 - GitHub
This process repeats for each character you input. Device: Samsung Galaxy S4 SCH-I545 OS: Android 4.2.2. Browser: Chrome
Read more >
Find the first repeated character in a string - GeeksforGeeks
Start traversing from left side. For every character, check if it repeats or not. If the character repeats, increment count of repeating ......
Read more >
Restriction of Repeated Characters for Passwords ... - IBM
The Restriction of Repeated Characters for Passwords (QPWDLMTREP) system value limits the use of repeating characters in a password.
Read more >
Character repeating in a string - python - Stack Overflow
I believe you want to print each character of the input string twice, in order. The issue with your attempt is your use...
Read more >
Repeat a character in a cell - Microsoft Support
Let's say you want to create a fixed column of special characters to format a report or add periods ... To repeat a...
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