Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Directive on chrome browser (android) not apply the mask. #454

Closed
henriquecustodia opened this issue Oct 28, 2019 · 7 comments
Closed

Directive on chrome browser (android) not apply the mask. #454

henriquecustodia opened this issue Oct 28, 2019 · 7 comments

Comments

@henriquecustodia
Copy link

henriquecustodia commented Oct 28, 2019

Directive on chrome browser (android) not apply the mask.

On desktop (macOS, windows, etc) using chrome and iOS 10 (chrome and safari), works fine.

I think the componentUpdated hook of directive is "overriding" the value (masked) to a value not masked after the parent component has a change.

Seems that problem has relation with this code:

 function triggerInputUpdate(el) {
    var fn = trigger.bind(null, el, 'input');

    if (isAndroid && isChrome) {
      setTimeout(fn, 0);
    } else {
      fn();
    }
  }

Changing the code above to:

   function triggerInputUpdate(el) {
        trigger.bind(null, el, 'input')();
    }

Seems fix the bug.

V-Mask and Vue versions

2.0.2, 2.6.10

Reproduction Link

Steps to reproduce

  1. Use the directive on Chrome for Android
  2. Type a value
  3. The mask won't be applied
@kheguy
Copy link

kheguy commented Nov 14, 2019

I have the same issue. Chrome 78, Android 5.1

<input
  v-model="authTelephone"
  type="tel"
  v-mask="'+7 (###) ###-##-##'"
  placeholder="+7"
  name="phone"
  class="txt-field"
/>

@theprobugmaker
Copy link

It's not working for me either, it only applies the mask when focusing the input

@EduardoNakatsuka
Copy link

Same issue here, on iphone works fine but not on android

@cchooley
Copy link

Exact same issue as well. We've only started experiencing this issue on the devices we're testing on roughly a week or so ago, but it is indeed happening and only on Android chrome.

Any efforts to address this issue would be greatly appreciated as this is a GREAT package overall and we really like using it in my shop.

@ekeyte
Copy link
Contributor

ekeyte commented May 29, 2020

@henriquecustodia and friends: I have opened a PR (above) to address this issue, but I am unable to easily test it since every device I own is an Apple product. Any chance you guys could try to grab that tag and see how it performs?

@probil probil closed this as completed in d2ad3e2 Jul 21, 2020
probil added a commit that referenced this issue Jul 21, 2020
fix: #454 android doesnt apply mask
@github-actions
Copy link

🎉 This issue has been resolved in version 2.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mlaw93
Copy link

mlaw93 commented Jul 29, 2020

Just FYI, this resolved same issue on Chrome (OS X) when in debug and using "Toggle Device Toolbar" feature

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants