Skip to content

Commit

Permalink
Properly check window.event.shiftKey
Browse files Browse the repository at this point in the history
Only KeyboardEvent has the shiftKey property.
  • Loading branch information
victorlin committed Nov 12, 2024
1 parent 83326a2 commit 25294e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/tree/reactD3Interface/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 25294e8

Please sign in to comment.