dgreene1 / react-accessible-treeview

A react component that implements the treeview pattern as described by the WAI-ARIA Authoring Practices.
https://dgreene1.github.io/react-accessible-treeview
MIT License
261 stars 37 forks source link

Option to turn off keyboard navigation #144

Closed ctse020 closed 1 year ago

ctse020 commented 1 year ago

I want to use this component in combination with a multiline textfield in a sub node. But in the textfield when I press the enter key or space key, the onSelect event of the tree triggers this key press event. Is there a way to turn off keyboard navigation completely in the tree?

dgreene1 commented 1 year ago

I’m sorry, but we don’t have support capacity for Stack Overflow type of questions. If it’s not in our documentation or our unit tests then it likely isn’t supported. If it’s not, we’re open to PRs, but we would need a more informative explanation of the value proposition before saying yes to the feature.

ctse020 commented 1 year ago

Ok, as a workaround I solved it like this:

<TreeView onKeyDown={(evt) => { evt.stopPropagation(); }} ...

rahuljoshi100 commented 10 months ago

Ok, as a workaround I solved it like this:

<TreeView onKeyDown={(evt) => { evt.stopPropagation(); }} ...

how did you add onKeyDown to TreeView? i am using typescript and that is not possible.

dennypenta commented 10 months ago

Ok, as a workaround I solved it like this: <TreeView onKeyDown={(evt) => { evt.stopPropagation(); }} ...

how did you add onKeyDown to TreeView? i am using typescript and that is not possible.

try updating the version, works fine for me