tleunen / react-number-editor

Custom number editor (text field) react component
MIT License
70 stars 15 forks source link

Add touch support #8

Closed acusti closed 9 years ago

acusti commented 9 years ago

This is actually totally trivial thanks to the touch option in your react-clickdrag component.

tleunen commented 9 years ago

I guess it will work, but I'm not sure about the behavior though.. Is it really usable on touch? I was initially thinking about having a classic number input (or range input) for mobile with touches...

acusti commented 9 years ago

I’d recommend you give it a try. The only change I made was the one shown in the PR. It works really well, I think; however, it’s also pretty much impossible to discover (which is why I added info text to explain it; in fact, the issue of discoverability also exists for users using a pointer). That’s really a UX issue, though, so it may be best handled on a case by case basis by the particular implementation of the control.

I have discovered one small bug, which is that at least in iOS, it is possible to tap the control in such a way to get a cursor inside it, but you don’t get an onscreen keyboard along with it.

tleunen commented 9 years ago

Nice use! Thanks, I'll try it later today

tleunen commented 9 years ago

Tested it and it works fine. It's not the best behavior for touch though but it works. And I've noticed to edit the field we have to hold the touch on the input.