Skip to content
Discussion options

You must be logged in to vote

Answering my own question: I made it work with using dispatch, it will check for the entered value and use the correct mask.

imaskCoupon = {
  mask: [
    {
      lazy: false,
      mask: '000 000 000 0',
      placeholderChar: '\u2000',
      startsWith: '012',
    },
    {
      lazy: false,
      mask: '000 000 000 0',
      placeholderChar: '\u2000',
      startsWith: '123',
    },
    {
      lazy: false,
      mask: '0000000000',
      placeholderChar: '\u2000',
      startsWith: '',
    },
  ],
  dispatch: function (appended, dynamicMasked) {
    const number = (dynamicMasked.value + appended).replace(/\D/g, '');

    return dynamicMasked.compiledMasks.find(function (m) {
      return

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by donroyco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant