Skip to content

Commit c43de31

Browse files
committed
Merge branch 'main' into chore/use-getEnv-in-oauth
2 parents 76f2e7b + 9867a47 commit c43de31

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

app/components/Button/Base.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const el = useTemplateRef('el')
2525
2626
defineExpose({
2727
focus: () => el.value?.focus(),
28+
getBoundingClientRect: () => el.value?.getBoundingClientRect(),
2829
})
2930
</script>
3031

app/components/ReadmeTocDropdown.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ function toggle() {
7979
if (isOpen.value) {
8080
close()
8181
} else {
82-
if (triggerRef.value) {
83-
const rect = triggerRef.value.getBoundingClientRect()
82+
const rect = triggerRef.value?.getBoundingClientRect()
83+
if (rect) {
8484
dropdownPosition.value = {
8585
top: rect.bottom + 4,
8686
right: rect.right,
@@ -145,18 +145,18 @@ function handleKeydown(event: KeyboardEvent) {
145145
</script>
146146

147147
<template>
148-
<button
148+
<ButtonBase
149149
ref="triggerRef"
150150
type="button"
151-
class="flex items-center gap-1.5 px-2 py-2 font-mono text-xs text-fg-muted bg-bg-subtle border border-border-subtle border-solid rounded-md transition-colors duration-150 hover:(text-fg border-border-hover) active:scale-95 focus:border-border-hover focus-visible:outline-accent/70 hover:text-fg"
152151
:aria-expanded="isOpen"
153152
aria-haspopup="listbox"
154153
:aria-label="$t('package.readme.toc_title')"
155154
:aria-controls="listboxId"
156155
@click="toggle"
157156
@keydown="handleKeydown"
157+
classicon="i-carbon:list"
158+
class="px-2.5 flex items-center"
158159
>
159-
<span class="i-carbon:list w-3.5 h-3.5" aria-hidden="true" />
160160
<span
161161
class="i-carbon:chevron-down w-3 h-3"
162162
:class="[
@@ -165,7 +165,7 @@ function handleKeydown(event: KeyboardEvent) {
165165
]"
166166
aria-hidden="true"
167167
/>
168-
</button>
168+
</ButtonBase>
169169

170170
<Teleport to="body">
171171
<Transition

0 commit comments

Comments
 (0)