mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00
Change: allow modifier+arrow keyboard shortcuts in input fields
This commit is contained in:
parent
8ea3259fe7
commit
4fa08a9c96
@ -45,11 +45,13 @@ export class HotKeyService {
|
|||||||
return new Observable((observer) => {
|
return new Observable((observer) => {
|
||||||
const handler = (e: KeyboardEvent) => {
|
const handler = (e: KeyboardEvent) => {
|
||||||
if (
|
if (
|
||||||
!(e.altKey || e.metaKey || e.ctrlKey) &&
|
(!(e.altKey || e.metaKey || e.ctrlKey) ||
|
||||||
|
e.key.toLowerCase().includes('arrow')) &&
|
||||||
(e.target instanceof HTMLInputElement ||
|
(e.target instanceof HTMLInputElement ||
|
||||||
e.target instanceof HTMLTextAreaElement)
|
e.target instanceof HTMLTextAreaElement)
|
||||||
) {
|
) {
|
||||||
// Ignore keydown events from input elements that dont have a modifier key
|
// Ignore keydown events from input elements that dont have a modifier key
|
||||||
|
// or if the key is an arrow key to allow for navigation within the input
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user