mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-26 01:16:16 +00:00
Fix: correctly handle global search esc key when open and button focused (#6644)
This commit is contained in:
@@ -318,6 +318,11 @@ export class GlobalSearchComponent implements OnInit {
|
||||
event.preventDefault()
|
||||
event.stopImmediatePropagation()
|
||||
this.primaryButtons.get(this.domIndex).nativeElement.focus()
|
||||
} else if (event.key === 'Escape') {
|
||||
event.preventDefault()
|
||||
event.stopImmediatePropagation()
|
||||
this.reset(true)
|
||||
this.searchInput.nativeElement.focus()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,7 +330,9 @@ export class GlobalSearchComponent implements OnInit {
|
||||
onButtonKeyDown(event: KeyboardEvent) {
|
||||
// prevents ngBootstrap issue with keydown events
|
||||
if (
|
||||
!['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(event.key)
|
||||
!['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft', 'Escape'].includes(
|
||||
event.key
|
||||
)
|
||||
) {
|
||||
event.stopImmediatePropagation()
|
||||
}
|
||||
|
Reference in New Issue
Block a user