(e: KeyboardEvent)
| 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]); |
nothing calls this directly
no test coverage detected