mantine
mantine copied to clipboard
[@mantine/core] NumberInput: Preserve cursor selection on format/parse
Related issue: https://github.com/mantinedev/mantine/issues/1905 and https://github.com/mantinedev/mantine/issues/1968
Before: https://user-images.githubusercontent.com/22859283/181459033-21669098-e90c-4173-9e60-677fbdc75a23.mov
After: https://user-images.githubusercontent.com/22859283/181459057-3de74e75-c259-4f90-9f2c-69990f35af0d.mov

https://github.com/mantinedev/mantine/pull/1908#issuecomment-1203107099 I solved the performance problem on Safari by using a useMemo for the input value so that it doesn't change with each render. If anyone can give me a hand to verify that it is really fixed, you would help me out :)
oh yeah, need this 🙏
@armoniaechaos it does not work as expected when there are extra symbols (input some numbers in sequence in formatter demo for reference):
https://user-images.githubusercontent.com/10353856/183123826-fd509965-f634-409a-9946-226cc19db190.mov
Related issue – #2024
Alright, I do not think that there is a good solution for it, @armoniaechaos if you find a way to fix it, feel free to reopen the PR