Skip to content

Commit

Permalink
Merge pull request #1901 from nextstrain/james/branch-shift-click-bugfix
Browse files Browse the repository at this point in the history
[bugfix] Restore shift-click branch behaviour
  • Loading branch information
jameshadfield authored Nov 14, 2024
2 parents 40d7b85 + 90fddc3 commit 628a6b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/tree/phyloTree/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface Regression {

// ---------- Callbacks ---------- //

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

export interface Callbacks {
onBranchClick: NodeCallback
Expand Down
4 changes: 3 additions & 1 deletion src/components/tree/reactD3Interface/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ 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 instanceof KeyboardEvent && window.event.shiftKey) {
/* NOTE: window.event is deprecated, however the version of d3-selection we're using doesn't supply
the event as an argument */
if (window.event instanceof PointerEvent && 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 628a6b5

Please sign in to comment.