Skip to content

What's the best way to handle moving the caret inside input field? #190

@bartoszgableta

Description

@bartoszgableta

Hi, I wanted to add input field to an app that uses Norigin-Spatial-Navigation as navigation library.

I have seen your answer in #169 on how that could be implemented, but moving the caret using 'left' and 'right' buttons is impossible. I guess the navigation has higher priority than native events.

I managed to overcome this by setting onKeyDown handler to the input element and calling stopPropagation when the keyDown is either ArrowLeft or ArrowRight:

Image

but maybe there is a better solution? I tried using the onArrowPress callback in useFocusable returning false for directions 'left' and 'right' but that didn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions