fix(keymap): clear shortcuts when a focused tree is removed (#1940)

Цей коміт міститься в:
Jaw authored and GitHub committed 2026-11-07 16:15:13 +08:00
1 джерело a36c7ed3d5
коміт d3ea6f6daf
5 files changed
+62 -17

No files matched your search

+2 -6
Переглянути файл
@@ -7,7 +7,6 @@
*/
import { useEffect, useMemo, useRef, type CSSProperties } from "react";
import type { DbDatabases, DbTableDetails } from "@/platform/ipc";
import { setContext } from "@/platform/context";
import { executeAction } from "@/platform/actions";
import { shortcutLabel } from "@/platform/keymap";
import {
@@ -378,13 +377,10 @@ export function DatabaseView() {
return (
<div className={styles.dbView}>
<DatabaseToolbar />
<div
className={styles.treeHost}
onFocus={(e) => setContext(DB_VIEW_FOCUS, (e.target as HTMLElement).getAttribute("role") === "tree")}
onBlur={() => setContext(DB_VIEW_FOCUS, false)}
>
<div className={styles.treeHost}>
<Tree<Node>
aria-label="Data sources"
focusContext={DB_VIEW_FOCUS}
roots={roots}
handleRef={tree}
expanded={st.treeExpanded}