@@ -56,99 +56,9 @@ useSeoMeta({
5656 />
5757 <hr v-if =" idx < posts.length - 1" class =" border-border-subtle" />
5858 </template >
59- <!-- :selected="toSuggestionIndex(unifiedSelectedIndex) === idx" -->
60- <!-- :is-exact-match="
61- (exactMatchType === 'org' && suggestion.type === 'org') ||
62- (exactMatchType === 'user' && suggestion.type === 'user')
63- " -->
64- <!-- @focus="handleBlogPostSelect" -->
65- <!-- </div> -->
6659 </article >
6760
6861 <p v-else class =" text-center py-20 text-fg-subtle" >No posts found.</p >
6962 </article >
7063 </main >
7164</template >
72-
73- <!--
74- // TODO: This should be extracted into a reusable form so search and blog post can both use it
75- // function scrollToSelectedItem() {
76- // const pkgIndex = toPackageIndex(unifiedSelectedIndex.value)
77- // if (pkgIndex !== null) {
78- // packageListRef.value?.scrollToIndex(pkgIndex)
79- // }
80- // }
81-
82- // function focusSelectedItem() {
83- // const suggIdx = toSuggestionIndex(unifiedSelectedIndex.value)
84- // const pkgIdx = toPackageIndex(unifiedSelectedIndex.value)
85-
86- // nextTick(() => {
87- // if (suggIdx !== null) {
88- // const el = document.querySelector<HTMLElement>(`[data-suggestion-index="${suggIdx}"]`)
89- // el?.focus()
90- // } else if (pkgIdx !== null) {
91- // scrollToSelectedItem()
92- // nextTick(() => {
93- // const el = document.querySelector<HTMLElement>(`[data-result-index="${pkgIdx}"]`)
94- // el?.focus()
95- // })
96- // }
97- // })
98- // }
99-
100- // function handleResultsKeydown(e: KeyboardEvent) {
101- // if (totalSelectableCount.value <= 0) return
102-
103- // const isFromInput = (e.target as HTMLElement).tagName === 'INPUT'
104-
105- // if (e.key === 'ArrowDown') {
106- // e.preventDefault()
107- // userHasNavigated.value = true
108- // unifiedSelectedIndex.value = clampUnifiedIndex(unifiedSelectedIndex.value + 1)
109- // if (isFromInput) {
110- // scrollToSelectedItem()
111- // } else {
112- // focusSelectedItem()
113- // }
114- // return
115- // }
116-
117- // if (e.key === 'ArrowUp') {
118- // e.preventDefault()
119- // userHasNavigated.value = true
120- // unifiedSelectedIndex.value = clampUnifiedIndex(unifiedSelectedIndex.value - 1)
121- // if (isFromInput) {
122- // scrollToSelectedItem()
123- // } else {
124- // focusSelectedItem()
125- // }
126- // return
127- // }
128-
129- // if (e.key === 'Enter') {
130- // if (!resultsMatchQuery.value) return
131-
132- // const suggIdx = toSuggestionIndex(unifiedSelectedIndex.value)
133- // const pkgIdx = toPackageIndex(unifiedSelectedIndex.value)
134-
135- // if (suggIdx !== null) {
136- // const el = document.querySelector<HTMLElement>(`[data-suggestion-index="${suggIdx}"]`)
137- // if (el) {
138- // e.preventDefault()
139- // el.click()
140- // }
141- // } else if (pkgIdx !== null) {
142- // const el = document.querySelector<HTMLElement>(`[data-result-index="${pkgIdx}"]`)
143- // if (el) {
144- // e.preventDefault()
145- // el.click()
146- // }
147- // }
148- // }
149- // }
150-
151- // function handleBlogPostSelect(index: number) {
152- // // Convert suggestion index to unified index
153- // unifiedSelectedIndex.value = -(suggestionCount.value - index)
154- // } -->
0 commit comments