在jQuery UI Datepicker中添加“ readonly”属性是否会影响其可访问性? [英] Does adding 'readonly' attribute to jquery ui datepicker affect its accessibility?

查看:170
本文介绍了在jQuery UI Datepicker中添加“ readonly”属性是否会影响其可访问性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery UI datepicker控件,但不希望当用户单击输入字段时在移动设备/平板电脑上显示键盘。

I'm using the jquery UI datepicker control but do not want the 'keyboard' to display on mobile/tablet when a user clicks on the input field.

防止这种情况的一种方法是在输入中添加 readyonly = readonly。

A way to prevent this is to add 'readyonly=readonly' to the input.

但是,我担心这会对可访问性产生负面影响。

However, I'm concerned that this will negatively affect accessibility.

用户仍可以使用屏幕阅读器编辑字段/选择日期。

Will users, using a screen reader, still be able to edit the field / select a date.

https://jqueryui.com/datepicker/

推荐答案

简短的回答是,对于视障用户来说,选择日期非常困难。

The short answer is yes, it will be very difficult for visually impaired users to select a date.

对于屏幕阅读器来说,如果他们使用NVDA和WindowEyes,体验不会有太大不同。因为这些屏幕阅读器不会宣布文本输入是否为只读。但是,JAWS会声明字段是否为只读。因此,这是一个包包,可能会给某些用户带来混乱。

In terms of screen readers, the experience will not too different if they are using NVDA and WindowEyes. Because these screen readers don't announce whether a text input is read-only or not. However, JAWS does announce if a field is read only. So it's a mixed bag and may cause confusion for some users.

但是,更重要的是,您应该意识到,许多盲人用户都依靠键盘输入日期。从表中选择日期对他们来说是一项繁琐的任务。因此,禁用键盘可能不是理想的解决方案。

But, more importantly, you should be aware that many blind users rely on keyboard to enter dates; picking a date from a table is a tedious task for them. So, disabling the keyboard may not be an ideal solution.

在我看来,最好使用日期选择器图标,而不要依赖于焦点事件。这样,有视力的用户就可以单击图标以显示选择器,而无需显示键盘。

In my opinion it is best use a date picker icon instead of relying on the focus event. This way, sighted users can click on the icon to display the picker without ever displaying the keyboard.

这篇关于在jQuery UI Datepicker中添加“ readonly”属性是否会影响其可访问性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆