weixin_39972996
2021-01-12 18:04 阅读 0

`digits` option ignored when first typing in the radix character

With Inputmask v4.X, when typing (in an empty input) the radix character first and then typing decimals, the digits limit is ignored and the user can type as many decimals as wanted.

The options used are:


    alias: 'decimal',
    placeholder: '',
    digits: 2,
    digitsOptional: true,
    groupSeparator: ' ',
    autoGroup: true,
    showMaskOnHover: false,
    showMaskOnFocus: false,
    clearIncomplete: false,

See a reproduction in this JSFiddle.

The same config works as intended in v3.X: JSFiddle.

Just to better illustrate the bug, here is a GIF with how to reproduce it:

inputmask

该提问来源于开源项目:RobinHerbots/Inputmask

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

8条回答 默认 最新

  • weixin_39761558 weixin_39761558 2021-01-12 18:04

    I'm currently having the same problem, have you found any solution?

    点赞 评论 复制链接分享
  • weixin_39972996 weixin_39972996 2021-01-12 18:04

    We're currently using v3.X, as we are time constrained and there was nothing we needed in v4.X for the time being. I'll post an update in this issue if we come up with a workaround or a fix.

    点赞 评论 复制链接分享
  • weixin_39761558 weixin_39761558 2021-01-12 18:04

    Allright, thanks for the reply.

    点赞 评论 复制链接分享
  • weixin_39686192 weixin_39686192 2021-01-12 18:04

    I've came across the same issue. Please fix it, I need 4.X :)

    点赞 评论 复制链接分享
  • weixin_39762856 weixin_39762856 2021-01-12 18:04

    ,

    I will fix this in v5.x

    点赞 评论 复制链接分享
  • weixin_39686192 weixin_39686192 2021-01-12 18:04

    Thanks , I'll be waiting. Awesome job btw.

    点赞 评论 复制链接分享
  • weixin_39638801 weixin_39638801 2021-01-12 18:04

    Came here to post about the same issue. Glad to see there will be a fix in 5.x! This is a really nice library. Thank you

    点赞 评论 复制链接分享
  • weixin_39762856 weixin_39762856 2021-01-12 18:04

    , , , ,

    Seemed already fixed in v5 ;) https://jsfiddle.net/h9y63bn2/

    点赞 评论 复制链接分享

相关推荐