Skip to content

Commit 628a6b5

Browse files
Merge pull request #1901 from nextstrain/james/branch-shift-click-bugfix
[bugfix] Restore shift-click branch behaviour
2 parents 40d7b85 + 90fddc3 commit 628a6b5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/tree/phyloTree/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface Regression {
3535

3636
// ---------- Callbacks ---------- //
3737

38-
type NodeCallback = (d: PhyloNode) => void
38+
type NodeCallback = (d: PhyloNode) => void // See <https://github.com/nextstrain/auspice/issues/1900>
3939

4040
export interface Callbacks {
4141
onBranchClick: NodeCallback

src/components/tree/reactD3Interface/callbacks.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export const onBranchClick = function onBranchClick(this: TreeComponent, d: Phyl
6161
if (this.props.narrativeMode) return;
6262

6363
/* if a branch was clicked while holding the shift key, we instead display a node-clicked modal */
64-
if (window.event instanceof KeyboardEvent && window.event.shiftKey) {
64+
/* NOTE: window.event is deprecated, however the version of d3-selection we're using doesn't supply
65+
the event as an argument */
66+
if (window.event instanceof PointerEvent && window.event.shiftKey) {
6567
// no need to dispatch a filter action
6668
this.props.dispatch({type: SELECT_NODE, name: d.n.name, idx: d.n.arrayIdx, isBranch: true, treeId: d.that.id})
6769
return;

0 commit comments

Comments
 (0)