Skip to content

Commit

Permalink
fix: #454 android doesnt apply mask
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Keyte committed May 29, 2020
1 parent 6aa8177 commit d2ad3e2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/directive.js
Expand Up @@ -3,19 +3,19 @@
import conformToMask from 'text-mask-core/src/conformToMask';
import { stringMaskToRegExpMask, arrayMaskToRegExpMask } from './maskToRegExpMask';
import { trigger, queryInputElementInside } from './utils';
import { isAndroid, isChrome } from './utils/env';
import createOptions from './createOptions';
import { defaultMaskReplacers } from './constants';

const options = createOptions();

/**
* Convenience wrapper for `trigger(el, 'input')`, which raises
* an event for Vue to detect a value change.
*
* @param {HTMLInputElement} el
*/
function triggerInputUpdate(el) {
const fn = trigger.bind(null, el, 'input');
if (isAndroid && isChrome) {
setTimeout(fn, 0);
} else {
fn();
}
trigger(el, 'input');
}

/**
Expand Down Expand Up @@ -62,7 +62,7 @@ function updateMask(el, inputMask, maskReplacers) {
/**
* Merge custom mask replacers with default mask replacers
* @param {Object<string, RegExp>} maskReplacers
* @param {Objext<string, RegExp>} baseMaskReplacers
* @param {Object<string, RegExp>} baseMaskReplacers
* @return {Object} The extended mask replacers
*/
function extendMaskReplacers(maskReplacers, baseMaskReplacers = defaultMaskReplacers) {
Expand Down

0 comments on commit d2ad3e2

Please sign in to comment.