我在我的应用程序中使用material-ui-pickers日历,用于在月份之间导航的左右图标箭头按钮缺少aria-labels,这是一个严重的可访问性故障:https://dequeuniversity.com/rules/axe/3.5/button-name?application=axeAPI
有没有人建议我如何向下传递一个aria-label到这个组件中,或者附加一个aria-labelledby?
谢谢。
发布于 2020-05-01 05:20:19
一个普通的JS解决方案应该是:
document.querySelectorAll(".MuiPickersCalendarHeader-iconButton")[0].setAttribute("aria-label", "go to the previous month");
document.querySelectorAll(".MuiPickersCalendarHeader-iconButton")[1].setAttribute("aria-label", "go to the next month");https://stackoverflow.com/questions/61530261
复制相似问题