[Input Masks Library] backspace or delete won't trigger InputMask_OnChange with single digit
Reactive icon
Forge component by Labs
Application Type

When the loaded value is a single digit (1 - 9) and I delete the value without first changing it, using backspace or delete the InputMask_OnChange won't trigger.

The visible value is changed to 0, but when I inspect the HTML Value remains the same and when I save the value it isn't changed.

But when I change the value once and then delete the value everything works fine and the 0 value is saved.

Hopefully someone has a solution for this.

Kind regards,


I had the same issue and I fixed it by setting "0" as default value in the maskedvalue variable inside the inputmasklibrary 

Tnx that solved the problem.

Hey guys, I know this post is solved but for those of you who have this problem with the currency input mask and cannot solve it with Nick's suggestion(happened to me), I wrote a small jQuery script to work this issue around. I placed the JS node inside the OnRender lifecycle hook:

$('.your-input-class.masked-value').one('keyup', function(e){

    if(e.keyCode === 8 || e.keyCode === 46) {

        if($(this).val() === 0 || $(this).val() === undefined || $(this).val() === "") {

            // Set input val attr

            $(this).attr('value', "0");



            // Set hidden input val attr

            var hiddenInput = $(this).closest('.currency-mask').find('.vanilla-input').find('.your-input-class');

            hiddenInput.attr('value', "0");





What this does is detecting an input clear by backspacing or deleting the input value. This solution is fairly new so it might need some tweeks on your side. Also make sure that you call your OnChange action at the end of the keyup event.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.