[InputMask React] Removing right align

Forge Component
(1)
Published on 13 Jul (4 weeks ago) by João Barata
1 vote
Published on 13 Jul (4 weeks ago) by João Barata

Hello,


Can anyone help me removing the rightAlign property for the decimals mask? I saw on the github documentation some information related to this but I couldn't manage to do it in a reactive application.


https://github.com/RobinHerbots/Inputmask#rightalign


Regards,

Bogdan

Hi Bogdan,

when you see for decimal or number input in input mask by default property is 

text-align: right;

you can overwrite this

go to input property and set

style:"text-align: left"


Regards

Rahul Sahu

Hi Rahul,


It still doesn't work like this. It seems the style is somehow applied using the javascript from this library. I would need something in the OnReady for the screen in order to set the rightAlign property to false (or !0 idk).


See below example from the javascript where this property is set


Regards,

Bogdan

Solution

Ok,


I think I found some solution for now, in the JS (inputmask_min.js) I modified the rightAlign: 0! with rightAlign: 1! wherever it occured and now text is left aligned.


I'm sure there are also other options to do it via a JS in the screen you are using this widget, but this does the job for me as well.


Regards,

Bogdan

Solution

Hi, thanks for bringing this to my attention,

I'll try to create a new version that has more options for you to customize the behavior of the input mask.

Regards,

Hello,

If you don't want to customize the plugin you also can solve this using JS on the screen. You can do something like this in the OnReady function of your screen or web block:


Regards,

Joana Salgueiro