Hello,
We are continuously getting the following error message;
Cannot read properties of undefined (reading 'replace')
TypeError: Cannot read properties of undefined (reading 'replace')
Does anyone know how we can fix this?
Kind regards,
Furkan Çetin
Hi Furkan,
Can you share some details of your implementation? Also, did you check the browser's developer tools to check where that exception is raised?
Cheers,
António Pereira
Indeed, some more information on this problem might help. What makes you think it is related to the Input Mask Reactive components for example?
Can you reproduce the problem in a small example module that you can share?
Regards,
Steven
Hi Guys,
We do have this problem again and again;
I do not know how to reproduce this problem in a small example, but I will try and if I can reproduce it I will share it
Furkan
I have found the reason;
I had created two webblocks; 1 for normal numbers/decimals and 1 for percentages
Within these webblocks I had used the 'InputNumberMask' to define the basic settings in one central place for all the input fields. Within a screen I was using both webblocks and the error was caused by the percentage webblock. After removing the percentage webblock the error was gone.
I do want to mention that for some reason the min and max input parameters don't work and I do need this for percentages
I have found the problem of the min and max input parameters;
In the 'InputNumberMask -> InitIMask -> RegisterInputMask' the code;
if ($parameters.Min !== 0) { maskOptions.min = $parameters.Min; } if ($parameters.Max !== 0) { maskOptions.max = $parameters.Max; }
must be changed to
if ($parameters.Min !== 0) { maskOptions.blocks.num.min = $parameters.Min; } if ($parameters.Max !== 0) { maskOptions.blocks.num.max = $parameters.Max; }
Would you change this in the code and publish a new version of the component?
Thanks for finding (and fixing) this bug!
I've included the proposed changes to the code. They can be found in the new 1.0.5 version. Min and max properties should now work as intended.
Hi Steven,
In our situation, the issue has been resolved, but after a few minutes of inactivity, this issue reoccurs. Maybe this information can help you for fixing it?
Kind Regards,