Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one-way-input-mask with custom mask does not work after upgrade #114

Open
wuarmin opened this issue Dec 16, 2019 · 1 comment
Open

one-way-input-mask with custom mask does not work after upgrade #114

wuarmin opened this issue Dec 16, 2019 · 1 comment

Comments

@wuarmin
Copy link

wuarmin commented Dec 16, 2019

Hi,
following setup worked properly with ember-inputmask versions < 0.7

//mask-definition
import Inputmask from 'inputmask';

export function initialize(/* application */) {
  Inputmask.extendAliases({
    euro: {
      suffix: " €",
      groupSeparator: ".",
      radixPoint: ",",
      alias: "numeric",
      placeholder: "0",
      autoGroup: !0,
      digits: 2,
      digitsOptional: !1,
      clearMaskOnLostFocus: !1,
      autoUnmask: true,
      unmaskAsNumber: true
    }
  });
}

export default {
  initialize
};
{{one-way-input-mask value=12.58 mask="euro"}}

image
Since ember-inputmask > 0.7, the same output results in following output:
image
The given value (12.58) is multiplicated by 100. Why?
Can you help me?

thank you

@brandynbennett
Copy link
Collaborator

It looks like this is an ongoing issue with Inputmask.js. See: RobinHerbots/Inputmask#1655
However, it looks like a fix is coming 🤞 from RobinHerbots/Inputmask@8177635

Best advice I can give right now is if you have data that already exists that you want to display, to format the numbers yourself so that the input will understand them. Then typing from there should work fine. This sucks, but hopefully in the 5.0 release of Inputmask.js it will work as expected

{{one-way-number-mask 
  value='12,58'
  decimal=true
  options=(hash
    suffix=" €"
    groupSeparator='.'
    radixPoint=',')}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants