简体   繁体   English

辅助功能-Android对讲不会在HTML内容上触发焦点事件

[英]Accessibility - Android Talkback doesn't fire focus event on HTML content

I'm trying to execute/receive a onfocus HTML event using Talkback on an Android Device (Moto G Android 4.4.3) on an HTML page while selecting an input field. 我正在尝试在HTML input页面上的Android设备(Moto G Android 4.4.3)上使用“ onfocus执行/接收onfocus HTML事件。

I created on single input text with an onfocus event : this event never get called when using "touch explorer" with talkback. 我使用onfocus事件在单个输入文本上创建:当将“触摸资源管理器”与对讲一起使用时,永远不会调用此事件。 When I select/hover it with Talkback there is a little outline over my field it but it's not the HTML :focus state : 当我使用“话语提示”选择/悬停它时,我的字段上有一个轮廓,但这不是HTML :focus状态:

<input type="text" id="myInput" onfocus="focusFunction()" onblur="blurFunction()">

See this fiddle for an example : https://jsfiddle.net/hpgqmz7f/embedded/result/ 有关示例,请参见此小提琴: https : //jsfiddle.net/hpgqmz7f/embedded/result/

On IOS + VoiceOver or Chrome@PC + NVDA, the focus event is called without problem.. 在IOS + VoiceOver或Chrome @ PC + NVDA上,焦点事件的调用没有问题。

Thanks for the help 谢谢您的帮助

edit: this page show that with assistive technology, Talkback should trigger a focus on 1st tap 编辑: 此页面显示,借助辅助技术,“对讲”应触发对第一个点击的关注

Mobile screen readers (VoiceOver and TalkBack) that are designed to be used with touch screens, introduce a special type of "accessibility focus". 设计用于触摸屏的移动屏幕阅读器(VoiceOver和TalkBack)引入了一种特殊的“可访问性焦点”。 This focus is tracked only by the Assistive Tech. 仅通过辅助技术跟踪此焦点。 The AT tracks this focus separately from other types of focus you're use to in Web Development vernacular. AT会将此关注点与您在Web开发中常用的其他关注点类型分开跟踪。 It is this type of focus that gets shifted after a single tap, called touch to explore. 只需单击一下即可将这种焦点转移,称为触摸探索。 Both major mobile screen readers support a touch to explore mode. 两种主要的移动屏幕阅读器均支持触摸浏览模式。 This is why your text field onFocus event is not firing. 这就是为什么您的文本字段onFocus事件没有触发的原因。 It hasn't received focus yet. 它尚未得到关注。 It has received "Accessibility Focus" and after the user double taps, it should receive a tap event, which then should cause the normal focus events to fire. 它已收到“可访问性焦点”,并且在用户双击之后,它应该收到一个轻击事件,这将导致正常的焦点事件触发。

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

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