MCPcopy Create free account
hub / github.com/arktypeio/arktype / onScopeKeyDown

Function onScopeKeyDown

ark/docs/components/shell/SearchPanel.tsx:252–263  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

250 }
251
252 const onScopeKeyDown = (e: KeyboardEvent) => {
253 if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return
254 e.preventDefault()
255 const step = e.key === "ArrowRight" ? 1 : -1
256 const i = mod(
257 scopes.findIndex(s => s.index === scope) + step,
258 scopes.length
259 )
260 chooseScope(scopes[i].index)
261 const radios = e.currentTarget.querySelectorAll<HTMLElement>("[role=radio]")
262 radios[i]?.focus()
263 }
264
265 return (
266 <div

Callers

nothing calls this directly

Calls 2

modFunction · 0.85
chooseScopeFunction · 0.85

Tested by

no test coverage detected