当日历聚焦和模糊时,NVDA屏幕阅读器在FF中多次读取日期

时间:2015-11-24 14:04:21

标签: jquery datepicker nvda

您好我正在尝试为NVDA提供辅助功能。

当我导航到其他日期时,datepicker正在读取日期。

我的问题是,在最初打开datepicker时,重点日期会被读取4-10次。当<p>Date: <input id="datepicker" type="text"> <button id="add_30">Add 30 days </button> <button id="add_60">Add 60 days </button> <button id="add_90">Add 90 days </button> </p> <div id="liveRegion" aria-live="assertive"></div> 关闭时,日期读数为4-10次

HTML:

var message;
 function emitChanges(){                
//Emit message
    message = ' ' + $('.ui-state-hover').html() + ' ' + $('.ui-datepicker-month').html() + ' ' + $('.ui-datepicker-year').html();
    document.getElementById('liveRegion').innerHTML = message;
  }

//Check for changes to DOM 
var target = document.querySelector('#ui-datepicker-div');

if(!document.attachEvent) {
    //Using not attachEvent to filter out IE 8 & 9.
    var observer = new MutationObserver(function(mutations){
      emitChanges();
    });
    var config = { attributes: true, characterData: true };
    observer.observe(target, config);
  } else {
    //Using event attach for IE8
    target.attachEvent("onpropertychange", emitChanges);
  }

JS:

var myData= {
     Email: "me@email.com"
};

如何解决此问题。我可以使用任何角色或aria属性来阻止它多次阅读。

在这里小提琴:http://jsfiddle.net/archanabr05/D4AGz/719/

0 个答案:

没有答案