From 25294e899be20256844e26cdfb5d6b550616b6eb Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:11:34 -0700 Subject: [PATCH] Properly check window.event.shiftKey Only KeyboardEvent has the shiftKey property. --- src/components/tree/reactD3Interface/callbacks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tree/reactD3Interface/callbacks.ts b/src/components/tree/reactD3Interface/callbacks.ts index b833f95c6..e9c11804f 100644 --- a/src/components/tree/reactD3Interface/callbacks.ts +++ b/src/components/tree/reactD3Interface/callbacks.ts @@ -61,7 +61,7 @@ export const onBranchClick = function onBranchClick(this: TreeComponent, d: Phyl if (this.props.narrativeMode) return; /* if a branch was clicked while holding the shift key, we instead display a node-clicked modal */ - if (window.event.shiftKey) { + if (window.event instanceof KeyboardEvent && window.event.shiftKey) { // no need to dispatch a filter action this.props.dispatch({type: SELECT_NODE, name: d.n.name, idx: d.n.arrayIdx, isBranch: true, treeId: d.that.id}) return;