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

Function keys

graph-ui/src/projects/AddProjectIndexDialog.tsx:124–132  ·  view source on GitHub ↗
(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

122 opener.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
123 (pathField.current ?? panel.current)?.focus();
124 const keys = (event: KeyboardEvent): void => {
125 if (event.key === 'Escape') { event.preventDefault(); event.stopPropagation(); closeCallback.current(); return; }
126 if (event.key !== 'Tab') return;
127 const controls = [...(panel.current?.querySelectorAll<HTMLElement>('button:not(:disabled), input:not(:disabled), [tabindex="0"]') ?? [])];
128 const first = controls[0], last = controls[controls.length - 1];
129 if (!first) { event.preventDefault(); panel.current?.focus(); return; }
130 if (event.shiftKey && (document.activeElement === first || document.activeElement === panel.current)) { event.preventDefault(); last.focus(); }
131 else if (!event.shiftKey && (document.activeElement === last || !panel.current?.contains(document.activeElement))) { event.preventDefault(); first.focus(); }
132 };
133 window.addEventListener('keydown', keys, true);
134 return () => { window.removeEventListener('keydown', keys, true); if (opener.current?.isConnected) opener.current.focus(); };
135 }, [open]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected