Does the aria-expanded and aria-haspopup attributes apply to <select /> elements?

对着背影说爱祢 提交于 2019-12-11 04:11:13

问题


From the W3C wiki

When authors use collapsible content, for example, to hide navigation menus or lists of content, the triggering link or button should indicate to screen reader users whether the collapsable content below is in the expanded or in the collapsed state. The aria-expanded attribute is used for this purpose.

Does this include <select> elements or is this only for navigation items?


回答1:


The select element can accept any global aria-* attribute, and any aria attribute applicable to the role listbox.

aria-haspopup is allowed for any role, and aria-expanded is allowed for the listbox role.

Note that, the browser should already define the default implicit semantic so you do not have to care about defining an aria attribute to define the state of the select control if you're using the native element.



来源:https://stackoverflow.com/questions/40085027/does-the-aria-expanded-and-aria-haspopup-attributes-apply-to-select-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!