Open nmbrone opened 4 years ago
Hi there 👋
iPhone
Safary/Chrome
I'm using the plugin like in the code example
var mask0 = '0000 0000 0000 0000 000'; var mask1 = '0000-0000-0000-0000'; var mask2 = 'DDDD DDDD DDDD DDDD DDD'; input.mask(mask0, { translation: { 0: { pattern: /[A-Za-z0-9]/ }, D: { pattern: /[0-9]/ } }, onKeyPress: (val, e, field, options) => { var mask; if (val === '') { mask = mask0; } else if (/^123/.test(val)) { mask = mask2; } else { mask = mask1; } input.mask(mask, options); } });
and it works great, but the only problem is that on mobile devices when a user pasting the copied value into the masked field the next error occurs
TypeError: undefined is not an object (evaluating 'p.maskDigitPosMapOld[i]')
https://github.com/igorescobar/jQuery-Mask-Plugin/blob/bfd14b5dc61b239a69458242b0c7014f1c17b8a9/src/jquery.mask.js#L224
Hi there 👋
Device
iPhone
Browser (and version)?
Safary/Chrome
Describe de problem depth:
I'm using the plugin like in the code example
and it works great, but the only problem is that on mobile devices when a user pasting the copied value into the masked field the next error occurs
https://github.com/igorescobar/jQuery-Mask-Plugin/blob/bfd14b5dc61b239a69458242b0c7014f1c17b8a9/src/jquery.mask.js#L224