Hey folks! Any idea on how to properly auto format decimal numbers inside a TextField based on the locale? Right now we figured out a half working solution using number formatter. But the cursor does not stay at the end of the number and periodically moves one step further to the front.
d
Daniel
03/01/2021, 7:15 PM
Is the issue that the length of the number changes @Timon Bohn? If so, you can compute the new cursor position and set the TextField's cursor position in the TextFieldValue you pass in
Daniel
03/01/2021, 7:16 PM
(You would check and see if you're adding text before the cursor, and if so subtract the amount you're adding from the cursor position)
Daniel
03/01/2021, 7:17 PM
It's not intuitive, but if you set the selection range start and end to the same position it apparently represents the cursor being at that position