From b060167e24f2a55e24b0e0786c47e9f4dfceb5e0 Mon Sep 17 00:00:00 2001 From: James Hadfield Date: Fri, 9 Jul 2021 15:16:03 +1200 Subject: [PATCH] Inactivate tips when no longer focused Selecting a tip (and the corresponding info panel modal) is intrinsically linked to setting a single active "strain" filter. When clicking away from this modal the filter was removed. This caused issues in the situation where "a tip is selected under a filter, then you click on that tip to see more information, when you click away to close the box, the filter is removed." The solution here is to inactivate the strain filters when removing the info panel. This has the benefit (bug?) of keeping a history of clicked tips in the form of inactive filters. (Note that all strain filters can be removed by a single click in the sidebar filter badge.) Closes https://github.com/nextstrain/auspice/issues/1357 --- src/components/tree/reactD3Interface/callbacks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tree/reactD3Interface/callbacks.js b/src/components/tree/reactD3Interface/callbacks.js index d81c61c0e..2a7267787 100644 --- a/src/components/tree/reactD3Interface/callbacks.js +++ b/src/components/tree/reactD3Interface/callbacks.js @@ -125,5 +125,5 @@ export const clearSelectedTip = function clearSelectedTip(d) { .attr("r", (dd) => dd["r"]); this.setState({selectedTip: null, hovered: null}); /* restore the tip visibility! */ - this.props.dispatch(applyFilter("remove", strainSymbol, [d.n.name])); + this.props.dispatch(applyFilter("inactivate", strainSymbol, [d.n.name])); };