Changed my mind about shortcut keys

This commit is contained in:
shamoon
2024-04-04 23:46:48 -07:00
parent 63157583f3
commit 097566e3d1
4 changed files with 12 additions and 17 deletions

View File

@@ -150,14 +150,8 @@ describe('GlobalSearchComponent', () => {
it('should handle keyboard nav', () => {
const focusSpy = jest.spyOn(component.searchInput.nativeElement, 'focus')
document.dispatchEvent(
new KeyboardEvent('keydown', { key: 'k', ctrlKey: true })
)
document.dispatchEvent(new KeyboardEvent('keydown', { key: '/' }))
expect(focusSpy).toHaveBeenCalled()
// coverage
document.dispatchEvent(
new KeyboardEvent('keydown', { key: 'k', metaKey: true })
)
component.searchResults = searchResults as any
component.resultsDropdown.open()

View File

@@ -88,7 +88,7 @@ export class GlobalSearchComponent implements OnInit {
ngOnInit() {
this.hotkeyService
.addShortcut({ keys: 'control.k', description: $localize`Global search` })
.addShortcut({ keys: '/', description: $localize`Global search` })
.subscribe(() => {
this.searchInput.nativeElement.focus()
})