Maskito - model value is masked too

Hi, I using ionic with maskito for input mask - test app here Ionic Docs Example - StackBlitz

But, why is changed model?

I need mask only for user but I model need clean without mask.

Any ideas for this isssue?

Thanks a lot

Good question! This is the first time I’ve looked at Maskito, but from what I found, the only way is through a post processor removing any mask characters.

Check out this StackBlitz.

For reference, this is the postprocessors bit:

postprocessors: [
  ({ value, selection }, initialElementState) => {
    this.myPhoneNumberUnmasked = value.replace(/(\+1)|[\( \)-]/g, '');

    return {
      value: value,
      selection: selection,
    };
  },
],

Thanks for answer. Awesome idea, but is it possible to use with reactive forms?

As you can see - model has mask IonInput: Maskito - Get value without mask (forked) - StackBlitz

You can store it in a record list. Making it fully dynamic by form control name, I am not sure :thinking: I don’t use Angular so just hacking here…lol.