adopted-ember-addons / ember-inputmask

Ember wrapper around Inputmask.js
https://adopted-ember-addons.github.io/ember-inputmask/
MIT License
68 stars 45 forks source link

optional part of mask discarded when unmaskedValue contains it #41

Open brayancastrop opened 7 years ago

brayancastrop commented 7 years ago

Hi,

For some reason having a variable which contains optional part of a mask it's discarded when loaded, for example:

Having this

{example: {number: '982748238992874822998724892932'}}

and

{{input-mask mask='(999) 999-9999[, (999) 999-9999][, (999) 999-9999][, (999) 999-9999]' unmaskedValue=example.number class='form-control'}}

it shows just the non optional part of the mask like if the mask were

mask='(999) 999-9999'

also noticed by using greedyMask=true it shows the missing parts plus the non fulfilled optional mask

brandynbennett commented 5 years ago

It looks like right now you need to pass in the masked version for it to appear. We need to get a better api for the components to determine whether it should expect an unmasked or masked value