react-accessible-treeview icon indicating copy to clipboard operation
react-accessible-treeview copied to clipboard

Pressing command + H causes infinite spin

Open bnovc opened this issue 1 year ago • 4 comments

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;

bnovc avatar Apr 30 '24 19:04 bnovc

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.

dgreene1 avatar May 01 '24 23:05 dgreene1

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.

bnovc avatar May 02 '24 16:05 bnovc

@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.

dgreene1 avatar May 02 '24 16:05 dgreene1

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

bnovc avatar May 02 '24 16:05 bnovc

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] avatar Jul 01 '24 17:07 stale[bot]

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

stale[bot] avatar Jul 08 '24 20:07 stale[bot]