Orange-OpenSource / react-keyboard-navigation

A React component to manage the navigation declaratively in KaiOS smart feature phone applications.
MIT License
8 stars 4 forks source link

Navigate through elements horizontally using left/right arrows #4

Open logesh2496 opened 4 years ago

logesh2496 commented 4 years ago

Hi, Everything is fine for up/down arrows. But my requirement is to navigated/focus from one element to another horizontally using left/right arrows. How do i achieve this? i can get the leftArrow event in softKeys, but how do i tell which position it has to focus now?

yannickcornaille commented 4 years ago

Hello @logesh2496 , thank you for this issue. Actually for the moment it is not possible to navigate horizontally using left/right arrows. I needed this system for a very small screen, with a very vertical design and no side by side UI element. However I understand the need, and I see several solutions. It would be possible easily to have the same behavior between the down arrow and the right arrow, and between the up arrow and the left arrow. Is that what you want ? If not, it would be necessary to add the functionality to listen to the up/down arrows and especially to find a declarative system to say that such an element is on the right or on the left. For example by integrating not 1 props (position) but 2 props (vPosition and hPosition). It would also be possible to imagine being able to define in each container the behavior of each arrow, with a function as a prop. I do not know if I'm clear... :worried:

Any other idea ?