Only reset on escape if filtered
This commit is contained in:
parent
e9b440428b
commit
f643938573
@ -604,6 +604,7 @@ describe('DocumentListComponent', () => {
|
||||
it('should support hotkeys', () => {
|
||||
fixture.detectChanges()
|
||||
const resetSpy = jest.spyOn(component['filterEditor'], 'resetSelected')
|
||||
jest.spyOn(component, 'isFiltered', 'get').mockReturnValue(true)
|
||||
component.clickTag(1)
|
||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'escape' }))
|
||||
expect(resetSpy).toHaveBeenCalled()
|
||||
|
@ -188,12 +188,15 @@ export class DocumentListComponent
|
||||
})
|
||||
|
||||
this.hotKeyService
|
||||
.addShortcut({ keys: 'escape', description: $localize`Clear selection` })
|
||||
.addShortcut({
|
||||
keys: 'escape',
|
||||
description: $localize`Reset filters / selection`,
|
||||
})
|
||||
.pipe(takeUntil(this.unsubscribeNotifier))
|
||||
.subscribe(() => {
|
||||
if (this.list.selected.size > 0) {
|
||||
this.list.selectNone()
|
||||
} else {
|
||||
} else if (this.isFiltered) {
|
||||
this.filterEditor.resetSelected()
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user