mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-13 10:12:47 +03:00
Make keyboard shortcuts consistent (#20326)
* Make keyboard shortcuts consistent * Cleanup * Refactor prevent default to not require separate input * Fix * Implement escape for reviews * Implement escape for explore * Send content ref to get page changes for free
This commit is contained in:
@@ -337,7 +337,7 @@ function Logs() {
|
||||
["PageDown", "PageUp", "ArrowDown", "ArrowUp"],
|
||||
(key, modifiers) => {
|
||||
if (!key || !modifiers.down || !lazyLogWrapperRef.current) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
const container =
|
||||
@@ -346,7 +346,7 @@ function Logs() {
|
||||
const logLineHeight = container?.querySelector(".log-line")?.clientHeight;
|
||||
|
||||
if (!logLineHeight) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
const scrollAmount = key.includes("Page")
|
||||
@@ -354,6 +354,7 @@ function Logs() {
|
||||
: logLineHeight;
|
||||
const direction = key.includes("Down") ? 1 : -1;
|
||||
container?.scrollBy({ top: scrollAmount * direction });
|
||||
return true;
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user