File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ export const initAria =
179179 ( { state, props } : Pick < IDropdownRenderlessParams , 'state' | 'props' > ) =>
180180 ( ) => {
181181 state . dropdownElm ?. setAttribute ( 'id' , state . listId )
182- state . triggerElm ?. setAttribute ( 'aria-haspopup' , 'list ' )
182+ state . triggerElm ?. setAttribute ( 'aria-haspopup' , 'menu ' )
183183 state . triggerElm ?. setAttribute ( 'aria-controls' , state . listId )
184184
185185 if ( ! props . splitButton || ! props . singleButton ) {
Original file line number Diff line number Diff line change 3030 @mousedown.stop
3131 :aria-disabled =" disabled"
3232 :tabindex =" disabled ? null : -1"
33+ role =" menuitem"
3334 >
3435 <div class =" tiny-dropdown-item__wrap" >
3536 <span
Original file line number Diff line number Diff line change 1818 v-show =" state.showPopper"
1919 @mouseenter =" handleMouseenter"
2020 @mouseleave =" handleMouseleave"
21+ role =" menu"
2122 >
2223 <template v-if =" state .initShowPopper || state .showPopper " >
2324 <slot :selected-index =" state.selectedIndex" >
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ export default defineComponent({
152152 class = { ` tiny-dropdown__caret-button ${triggerClass } ` }
153153 disabled = { disabled }
154154 reset-time = { 0 } >
155- <ButtonIconDown class = { visibleClass } ></ButtonIconDown >
155+ <ButtonIconDown class = { visibleClass } aria-label = " down " ></ButtonIconDown >
156156 </tiny-button >
157157 </tiny-button-group >
158158 )
@@ -169,7 +169,9 @@ export default defineComponent({
169169
170170 // 增加一层,vue3 环境中无法使用 slots.default 的方式获取原生 DOM 元素
171171 const suffixInner = showIcon ? (
172- <span class = { ' tiny-dropdown__suffix-inner ' + visibleClass } >{ suffixSlot || <IconDown ></IconDown >} </span >
172+ <span class = { ' tiny-dropdown__suffix-inner ' + visibleClass } >
173+ { suffixSlot || <IconDown aria-label = " down" ></IconDown >}
174+ </span >
173175 ) : (
174176 ' '
175177 )
@@ -194,15 +196,17 @@ export default defineComponent({
194196 class = { ` tiny-dropdown__border ${state .visible ? ' is-expand' : ' ' }${
195197 showIcon ? ' is-show-icon ' : ' '
196198 } ${triggerClass } ` }
197- reset-time = { 0 } >
199+ reset-time = { 0 }
200+ aria-label = " down" >
198201 { prefixInner }
199202 { defaultTriggerElm }
200203 { suffixInner }
201204 </tiny-button >
202205 ) : (
203206 <span
204207 ref = " trigger"
205- class = { ` is-text${state .visible ? ' is-expand' : ' is-hide' }${disabled ? ' is-disabled' : ' ' } ${triggerClass } ` } >
208+ class = { ` is-text${state .visible ? ' is-expand' : ' is-hide' }${disabled ? ' is-disabled' : ' ' } ${triggerClass } ` }
209+ aria-label = " down" >
206210 { prefixInner }
207211 { defaultTriggerElm }
208212 { suffixInner }
You can’t perform that action at this time.
0 commit comments