Search code examples
atata

FireFox NumberInput and TextInput behavior when using Set() with decimal points


I have a NumberInput defined thus:

[FindByXPath("//input[@class='form-control ']")]
public NumberInput<_> Amount { get; private set; }

For this input in the SUT:

<input id="ember293-mask" class="form-control " type="text" style="text-align: right;" im-insert="true">

When I use Amount.Set(123.45) it works great in Chrome, but in Firefox, it is only entering the two digits after the decimal point (the .45). It does the same thing if I define the input as a TextInput and Set a string with a decimal point. But, if I do Amount.Type(“123.45”) it works great on all browsers. Any suggestions on how to work around this?


Solution

  • You can try to change the behavior of a field value setting. Mark the Amount property with either [ValueSetUsingCharByCharTyping] or [ValueSetUsingScript] attribute.