x-model.number comma or dot as decimal separator erases field #4369
-
Hi, When I use I would love to use I made a fiddle to showcase this: Apparently the field erase only happens when the alternate decimal separator is added as last character - when I type Is there anything I am missing, and is there a way to do it with x-model.number? Or is it supposed to be locked for single decimal separator only? Thanks a lot for any suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You just kind of can't. It's an edge case you should handle in your code since there just isn't really much to do about it.
always or you write that code once? |
Beta Was this translation helpful? Give feedback.
-
I meant whenever I use the field value. The form is rather complex, we use calculations across rows, columns, some fields depend on other field's values etc. So would be more transparent if I could use the model value directly, rather then always wrapping it with parseFloat. But I see your point, I tried my own implementation, something like |
Beta Was this translation helpful? Give feedback.
You can just add an additional getter that calls parseFloat and use the decorated field anywhere else