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

Function open

ark/docs/components/shell/SearchDialog.tsx:40–52  ·  view source on GitHub ↗
(query = "")

Source from the content-addressed store, hash-verified

38
39 useEffect(() => {
40 const open = (query = "") => {
41 const element = dialog.current
42 if (!element || element.open) return
43 closePopups()
44 opener.current = document.activeElement
45 setSession(previous =>
46 previous && !query ? previous : { id: (previous?.id ?? 0) + 1, query }
47 )
48 setDraft(query)
49 setEntered(false)
50 setMoved(0)
51 element.showModal()
52 }
53 const onOpen = (e: Event) =>
54 open((e as CustomEvent<string | null>).detail ?? "")
55 const onKeyDown = (e: KeyboardEvent) => {

Callers 3

onOpenFunction · 0.85
onKeyDownFunction · 0.85
SearchDialogFunction · 0.85

Calls 1

closePopupsFunction · 0.90

Tested by

no test coverage detected