table-nav
table-nav copied to clipboard
Allow arrow keys characters navigation on input and textarea
We can't actually use arrow keys to navigate between characters
John|- Hit left arrow key ←
Expected: move cursor one step back Joh|n
Current Behavior: cursor doesn't move John|
You can try it in your own demo navigating using arrows (←→) on input editable field
I believe arrow keys shouldn't be blocked until ESC it's been hit first
BTW I worked around it with this:
<Textarea
onKeyDown={e => {
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
e.stopPropagation()
}
}}
/>
@pedro757 indeed I will fix that. Another thing you can do is disable the navigation until you get out from the input field. There is an example here: https://github.com/konsalex/table-nav/blob/main/packages/storybook/stories/NeedleTable.tsx#L76
Hope this helps