File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ const el = useTemplateRef('el')
2525
2626defineExpose ({
2727 focus : () => el .value ?.focus (),
28+ getBoundingClientRect : () => el .value ?.getBoundingClientRect (),
2829})
2930 </script >
3031
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments