简体   繁体   English

如何以屏幕阅读器仍会阅读文本并向用户指示已禁用的方式“禁用”单选按钮?

[英]How to “disable” a radio button in a way that a screen reader would still read the text and indicate to a user that it is disabled?

I have a use case where I want to disable some radio buttons, but there are ways to go back an re-enable this radio buttons. 我有一个要禁用一些单选按钮的用例,但是有一些方法可以使重新启用此单选按钮。 If I use the disabled attribute then screen readers will skip over the field and be unaware of important information. 如果我使用Disabled属性,那么屏幕阅读器将跳过该字段,并且不了解重要信息。

I'm looking for an accessible solution that would continue to work for standard users, but also be compatible across most screen readers as well. 我正在寻找一种可访问的解决方案,该解决方案将继续对标准用户有效,而且还与大多数屏幕阅读器兼容。

Only some few screenreaders skip disabled radio buttons as though there were not there ( eg. Jaws in Firefox for instance ). 只有少数屏幕阅读器会跳过禁用的单选按钮,就好像没有按钮一样( 例如Firefox中的下巴 )。 Other one will announce the item but state that it's disabled. 其他人将宣布该项目,但声明其已被禁用。 Of course, for the latter, the element will never gain focus but will be announced in reading mode. 当然,对于后者,该元素将永远不会获得关注,但会以阅读模式宣布。

If you want to handle all screenreaders and announce unselectable options, you can replace them with plain text with appropriate indications: 如果要处理所有屏幕阅读器并宣布不可选择的选项,则可以用带有适当指示的纯文本替换它们:

Selectable 可选

 <input type="radio" name="example value="1" />

Unselectable : 不可选择的:

 <div>1 (disabled option, you should select XXX to enable this option)</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM