Commit f7a74a2a authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Clear selection when a filter is set

parent 898d237b
......@@ -156,6 +156,10 @@ const update = {
return resetSelection();
},
SET_FILTER: function () {
return { ...resetSelection(), expanded: {} };
},
SET_FILTER_QUERY: function () {
return { ...resetSelection(), expanded: {} };
},
......
......@@ -159,6 +159,18 @@ describe('sidebar/store/modules/selection', () => {
});
});
describe('SET_FILTER', () => {
it('clears selection', () => {
store.selectAnnotations([1, 2, 3]);
store.setForcedVisible(2, true);
store.setFilter('user', { value: 'dingbat', display: 'Ding Bat' });
assert.isEmpty(store.selectedAnnotations());
assert.isEmpty(store.forcedVisibleAnnotations());
});
});
describe('SET_FILTER_QUERY', () => {
it('clears selection', () => {
store.selectAnnotations([1, 2, 3]);
......
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