react-pin-field icon indicating copy to clipboard operation
react-pin-field copied to clipboard

Since v4.0.0, Left & Right arrow keys on keyboard no longer focus on the next & previous input fields

Open jmcrthrs opened this issue 1 year ago • 1 comments

In previous versions the left & right arrow keys on the keyboard could be used to move the cursor to the next or previous input field.

https://github.com/soywod/react-pin-field/blob/f3679d9b13237f51a6805fe226052f6d57f5674a/lib/src/pin-field/pin-field.tsx#L125

Since v4.0.0 this functionality is no longer available:

Is this something that needs to be added myself via the new usePinField hook?

jmcrthrs avatar Feb 20 '25 13:02 jmcrthrs

The feature has been removed because it used to override the native behaviour (moving cursor inside a field). The v4 aims to limit interactions and rely as much as possible on native events. The onKeyDown is not overidable, but I can definitely add helpers to move cursor via usePinField. I let you know when I have sth working.

soywod avatar Mar 05 '25 10:03 soywod