Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Restore shift-click branch behaviour #1901

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading