You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the addon for a number mask.
I didn't find any example so I have to dig in the imaskjs documentation https://imask.js.org/guide.html#masked-number and the Java code.
I end up with this code:
new InputMask("Number", true,
InputMaskOption.option("scale", scale),
InputMaskOption.option("thousandsSeparator", StringToFormattedLongConverter.THOUSANDS_SEPARATOR),
InputMaskOption.option("radix", StringToFormattedLongConverter.DECIMAL_SEPARATOR))
.extend(innerField);
I think this example could be added in the demo/test but also we could improve the API so we could have the access to the configuration easily:
mask: Number, // enable number mask
// other options are optional with defaults below
scale: 2, // digits after point, 0 for integers
signed: false, // disallow negative
thousandsSeparator: '', // any single char
padFractionalZeros: false, // if true, then pads zeros at end to the length of scale
normalizeZeros: true, // appends or removes zeros at ends
radix: ',', // fractional delimiter
mapToRadix: ['.'], // symbols to process as radix
// additional number interval options (e.g.)
min: -10000,
max: 10000
That's the same issue for a regexp.
The text was updated successfully, but these errors were encountered:
InputMask inputMask = new InputMask("Number", true,
InputMaskOption.option("scale", 2),
InputMaskOption.option("thousandsSeparator", ' '), // space char does not work in Safari
InputMaskOption.option("radix", '.')
);
EDIT: The plugin seems quite buggy in Safari. One workaround is to change the valueChangeMode to BLUR. Apparently the change event is not necessary fired in Safari (so the value is not changed in Flow)
jcgueriaud1
changed the title
Add a better Java API for number
Add a better Java API for number and RegExp
Sep 1, 2023
I'm using the addon for a number mask.
I didn't find any example so I have to dig in the imaskjs documentation https://imask.js.org/guide.html#masked-number and the Java code.
I end up with this code:
I think this example could be added in the demo/test but also we could improve the API so we could have the access to the configuration easily:
That's the same issue for a regexp.
The text was updated successfully, but these errors were encountered: