MCPcopy Create free account
hub / github.com/arctic-cli/interface / handleTriggerFocus

Function handleTriggerFocus

packages/ui/src/components/dialog.tsx:25–36  ·  view source on GitHub ↗
(e: FocusEvent & { currentTarget: HTMLElement | null })

Source from the content-addressed store, hash-verified

23 }
24
25 const handleTriggerFocus = (e: FocusEvent & { currentTarget: HTMLElement | null }) => {
26 const firstChild = e.currentTarget?.firstElementChild as HTMLElement
27 if (!firstChild) return
28
29 firstChild.focus()
30 trigger.tabIndex = -1
31
32 firstChild.addEventListener("focusout", resetTabIndex)
33 onCleanup(() => {
34 firstChild.removeEventListener("focusout", resetTabIndex)
35 })
36 }
37
38 onMount(() => {
39 // @ts-ignore

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected