MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / keyDown

Function keyDown

graph-ui/src/settings/ConfigPanel.tsx:79–87  ·  view source on GitHub ↗
(event: KeyboardEvent<HTMLDivElement>)

Source from the content-addressed store, hash-verified

77 }, [embedded]);
78 const close = () => { if (pending.current) return; if (count) setConfirmClose(true); else onClose(); };
79 const keyDown = (event: KeyboardEvent<HTMLDivElement>) => {
80 if (event.key === 'Escape') { event.stopPropagation(); close(); }
81 if (event.key !== 'Tab') return;
82 const focusable = [...(dialog.current?.querySelectorAll<HTMLElement>('button:not(:disabled), input:not(:disabled), select:not(:disabled), summary, [tabindex="0"]') ?? [])].filter(element => element.getClientRects().length);
83 const first = focusable[0], last = focusable.at(-1);
84 if (!first) { event.preventDefault(); return; }
85 if (event.shiftKey && (document.activeElement === first || document.activeElement === dialog.current)) { event.preventDefault(); last?.focus(); }
86 else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first.focus(); }
87 };
88 const save = async () => {
89 if (!snapshot || pending.current || !count || invalid) return;
90 pending.current = true; setSaving(true); setError(''); setNotice('');

Callers

nothing calls this directly

Calls 1

closeFunction · 0.70

Tested by

no test coverage detected