mantine icon indicating copy to clipboard operation
mantine copied to clipboard

[@mantine/core] NumberInput: Preserve cursor selection on format/parse

Open armoniaechaos opened this issue 2 years ago • 3 comments

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

Schermata 2022-08-03 alle 10 28 08

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 :)

armoniaechaos avatar Aug 03 '22 08:08 armoniaechaos

oh yeah, need this 🙏

mmahalwy avatar Aug 03 '22 15:08 mmahalwy

@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

rtivital avatar Aug 05 '22 16:08 rtivital

Related issue – #2024

rtivital avatar Aug 06 '22 07:08 rtivital

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

rtivital avatar Aug 16 '22 12:08 rtivital