Commit c52e06d3 authored by Robert Knight's avatar Robert Knight

Don't clear selection when switching tabs

The `store.clearSelection()` call currently clears the selection and also all
other filters, which means that switching tabs changed several things in the UI
beyond just the current tab. Change this so it just changes the tab.
parent 850c5212
......@@ -115,7 +115,6 @@ function SelectionTabs({
const isWaitingToAnchorAnnotations = store.isWaitingToAnchorAnnotations();
const selectTab = (tabId: TabName) => {
store.clearSelection();
store.selectTab(tabId);
};
......
......@@ -40,7 +40,6 @@ describe('SelectionTabs', () => {
enableExperimentalNewNoteButton: false,
};
fakeStore = {
clearSelection: sinon.stub(),
selectTab: sinon.stub(),
isWaitingToAnchorAnnotations: sinon.stub().returns(false),
selectedTab: sinon.stub().returns('annotation'),
......@@ -295,7 +294,6 @@ describe('SelectionTabs', () => {
findButton(wrapper, label).simulate('click');
assert.calledOnce(fakeStore.clearSelection);
assert.calledWith(fakeStore.selectTab, tab);
});
});
......@@ -306,7 +304,6 @@ describe('SelectionTabs', () => {
findButton(wrapper, 'Page Notes').simulate('click');
assert.notCalled(fakeStore.clearSelection);
assert.notCalled(fakeStore.selectTab);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment