MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / Options

Function Options

packages/frontend/src/App.tsx:46–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46const Options: s.Component = () => {
47
48 let details!: HTMLDetailsElement
49
50 return (
51 <details
52 ref={details}
53 class="relative ml-auto"
54 on:focusout={e => {
55 // Close if focus moves outside the details element
56 if (!e.currentTarget.contains(e.relatedTarget as Node)) {
57 details.removeAttribute('open')
58 }
59 }}
60 on:keydown={e => {
61 switch (e.key) {
62 case 'Escape':
63 details.removeAttribute('open')
64 break
65 case 'ArrowDown':
66 case 'ArrowUp': {
67 e.preventDefault()
68 let root = details.getRootNode()
69 if (root instanceof Document || root instanceof ShadowRoot) {
70 let items = [...details.querySelectorAll('[role="menuitem"]')]
71 let focused_idx = items.indexOf(root.activeElement!)
72 let dir = e.key === 'ArrowDown' ? 1 : -1
73 let next_idx = (focused_idx + dir + items.length) % items.length
74 let el = items[next_idx]
75 if (el instanceof HTMLElement) el.focus()
76 }
77 break
78 }
79 }
80 }}>
81 <summary
82 class={`${ui.toggle_button} rounded-md ml-auto w-7 h-7`}>
83 <ui.icon.Options
84 class="w-4.5 h-4.5"
85 />
86 </summary>
87 <div
88 class='absolute z-9999 w-max top-0 right-full mr-2 p-1 rounded-md bg-panel-2 b b-solid b-panel-3'>
89 <div
90 role='menu'
91 class='flex flex-col items-stretch gap-0.5'>
92 <a
93 role='menuitem'
94 tabindex='0'
95 href='https://github.com/thetarnav/solid-devtools/issues'
96 target='_blank'
97 class='
98 flex items-center gap-1 p-1 rounded-md outline-none
99 text-text transition-colors hover:bg-orange-500/10 focus:bg-orange-500/10'>
100 <ui.icon.Bug class='w-3 h-3 mb-px text-orange-500 dark:text-orange-400' />
101 Report a bug
102 </a>
103 <a

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…