MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handler

Function handler

packages/react/src/components/tool-tree.tsx:363–378  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

361 el.tagName === "TEXTAREA" ||
362 el.tagName === "SELECT");
363 const handler = (e: KeyboardEvent) => {
364 if (
365 e.key === "/" &&
366 !e.metaKey &&
367 !e.ctrlKey &&
368 !e.altKey &&
369 !isEditing(document.activeElement)
370 ) {
371 e.preventDefault();
372 searchRef.current?.focus();
373 }
374 if (e.key === "Escape") {
375 searchRef.current?.blur();
376 if (search.length > 0) setSearch("");
377 }
378 };
379 document.addEventListener("keydown", handler);
380 return () => document.removeEventListener("keydown", handler);
381 }, [search]);

Callers

nothing calls this directly

Calls 1

isEditingFunction · 0.85

Tested by

no test coverage detected