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

Pressing command + H causes infinite spin #182

Closed bnovc closed 2 months ago

bnovc commented 4 months ago

Describe the bug With a tree view visible, if you press command + H (on a Mac, to hide the window), tree view has an infinite loop / freezes the page

It hangs in this code in the treeview, haven't fully followed it. 100% reproducing for me on my tree, but I don't see it on the examples. I don't have any key handling code, so I assume this is related to the large size of my tree but haven't narrowed down yet.

Is there any way to disable treeview from trying to handle these keys?

                default:
                    if (1 === e.key.length)
                        for (var R = X(t, b, n); R !== b; )
                            if (null != R) {
                                if (re(t, R).name[0].toLowerCase() === e.key.toLowerCase()) return void d({ type: j, id: R, lastInteractedWith: b });
                                R = X(t, R, n);
                            } else R = le(t).children[0];
                    return;
dgreene1 commented 4 months ago

There isn’t a way to stop it from handling this but if you’d like to submit a PR to have it work better, we’re open to it.

bnovc commented 4 months ago

Attempted to work around this by setting onKeyDown handlers above the tree and stopping the events or doing it on document.body, but no success.

Attempted to build this project, but it fails. Will probably have to get that working though since this breaks my browser every time I use the component.

dgreene1 commented 4 months ago

@bnovc I assure you that the project runs locally since our team is actively developing it. Perhaps you have an old version of Node or NPM?

You can see our node versions that we work on by looking in our github workflow file.

bnovc commented 4 months ago

Deleting that code block from the minified version fixed my issue, in case others want a quick fix as well

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 months ago

This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions.