简体   繁体   English

Jaws 正在读取上述字段组的输入字段

[英]Jaws is reading input field of above fieldgroup

 <div class="ms-Panel-content content-410"> <div class="panelSubheadingStyle-396"> We recommend you keep only one phone number and one address in your profile for easy communication. </div> <fieldset class="groupedElements-421"> <legend class="legendStyle-422"> <label class="ms-Label titleLabelStyle-423">Phone number</label> </legend> <div class="ms-TextField root-425"> <div class="ms-TextField-wrapper"> <div class="ms-TextField-fieldGroup fieldGroup-426"> <input type="text" id="TextField134" maxlength="15" class="ms-TextField-field field-427" aria-label="add phone number" aria-invalid="false" value="545465464" /> </div> </div> </div> </fieldset> <h3 class="panelSubheadTitleStyle-397">Address</h3> <fieldset class="groupedElements-436"> <legend class="legendStyle-422"> <label class="ms-Label titleLabelStyle-423" >Street address<span class="requiredLabelStyle-419" >&nbsp;(required)</span ></label > </legend> <div class="ms-TextField root-425"> <div class="ms-TextField-wrapper"> <div class="ms-TextField-fieldGroup fieldGroup-426"> <input type="text" id="TextField139" aria-required="true" maxlength="100" class="ms-TextField-field field-427" aria-label="add street address" aria-invalid="false" value="asd" /> </div> </div> </div> </fieldset> <fieldset class="groupedElements-436"> <legend class="legendStyle-422"> <label class="ms-Label titleLabelStyle-423" >City<span class="requiredLabelStyle-419">&nbsp;(required)</span></label > </legend> <div class="ms-TextField root-425"> <div class="ms-TextField-wrapper"> <div class="ms-TextField-fieldGroup fieldGroup-426"> <input type="text" id="TextField144" aria-required="true" maxlength="100" class="ms-TextField-field field-427" aria-label="add city" aria-invalid="false" value="city input" /> </div> </div> </div> </fieldset> <fieldset class="groupedElements-436"> <legend class="legendStyle-422"> <label class="ms-Label titleLabelStyle-423" >Country/region of residence<span class="requiredLabelStyle-419" >&nbsp;(required)</span ></label > </legend> <div class="ms-ComboBox-container dropdownStyle-394"> <div data-ktp-target="true" id="ComboBox149wrapper" class="ms-ComboBox css-437" > <input autocapitalize="off" autocomplete="off" aria-autocomplete="inline" data-ktp-execute-target="true" data-is-interactable="true" id="ComboBox149-input" class="ms-ComboBox-Input css-438" type="text" aria-expanded="false" role="combobox" aria-label="select your country or region" aria-describedby="ComboBox149-error" spellcheck="false" placeholder="Select a country/region" data-lpignore="true" value="Venezuela" style="font-family: inherit" /><button type="button" class="ms-Button ms-Button--icon ms-ComboBox-CaretDown-button root-446" role="presentation" data-is-focusable="false" tabindex="-1" > <span class="ms-Button-flexContainer flexContainer-67" data-automationid="splitbuttonprimary" ><i data-icon-name="ChevronDown" aria-hidden="true" class="ms-Icon root-32 css-321 ms-Button-icon icon-447" style="font-family: FabricMDL2Icons" ></i ></span > </button> </div> </div> </fieldset> <fieldset class="groupedElements-436"> <legend class="legendStyle-422"> <label class="ms-Label titleLabelStyle-423" >State/province<span class="requiredLabelStyle-419" >&nbsp;(required)</span ></label > </legend> <div class="ms-ComboBox-container dropdownStyle-394"> <div data-ktp-target="true" id="ComboBox153wrapper" class="ms-ComboBox css-437" > <input autocapitalize="off" autocomplete="off" aria-autocomplete="both" data-ktp-execute-target="true" data-is-interactable="true" id="ComboBox153-input" class="ms-ComboBox-Input css-438" type="text" aria-expanded="false" role="combobox" aria-label="select your state or province" aria-describedby="ComboBox153-error" aria-disabled="false" spellcheck="false" placeholder="Select a state/province" data-lpignore="true" value="" style="font-family: inherit" /><button type="button" class="ms-Button ms-Button--icon ms-ComboBox-CaretDown-button root-446" role="presentation" data-is-focusable="false" tabindex="-1" > <span class="ms-Button-flexContainer flexContainer-67" data-automationid="splitbuttonprimary" ><i data-icon-name="ChevronDown" aria-hidden="true" class="ms-Icon root-32 css-321 ms-Button-icon icon-447" style="font-family: FabricMDL2Icons" ></i ></span > </button> </div> </div> </fieldset> </div>

JAWS is not announcing text field information properly when focusing on 'city' text fields, as Jaws is reading previous field content information (street text box value).当关注“城市”文本字段时,JAWS 未正确宣布文本字段信息,因为 Jaws 正在读取以前的字段内容信息(街道文本框值)。 JAWS is reading the previous field value. JAWS 正在读取先前的字段值。 When moved by the down arrow key to the city or street address field.当通过向下箭头键移动到城市或街道地址字段时。 It should only announce the input field value of the field which is focussed and not the field above it.它应该只宣布焦点字段的输入字段值,而不是它上面的字段。

You are misusing <legend> here.您在这里滥用<legend> Don't use legend to label the controls inside a fieldset!不要将图例用于 label 字段集中的控件!

Don't put <label> in <legend> .不要将<label>放在<legend>中。 The legend is already a kind of label.传说已经是label的一种了。

A <fieldset> is primarily a semantic grouping mechanism, labelled by (ie "accessibly named by") the (optional) <legend> . <fieldset>主要是一种语义分组机制,由(可选的) <legend>标记(即“可访问地命名为”)。 The legend labels the entire group , rather than any of its individual "children".图例标记了整个组,而不是它的任何单独的“孩子”。

Yes, it is valid to have a fieldset containing only one control (or none at all), but... why would you want to do this?是的,拥有一个仅包含一个控件(或根本不包含任何控件)的字段集是有效的,但是......您为什么要这样做? That just adds complexity, unwelcome chatter (and extra keypresses) to the assistive tech experience of your content.这只会增加内容的辅助技术体验的复杂性、不受欢迎的喋喋不休(和额外的按键)。 As you have discovered, it also confuses the JAWS screen reader.正如您所发现的,它还会混淆 JAWS 屏幕阅读器。

Don't be seduced by the default visual appearance of a fieldset.不要被字段集的默认视觉外观所迷惑。 It is not purely presentational - it actually means something, so it will be included in the accessibility tree and will be announced by screen readers - as a group , not as a control.不是纯粹的展示 - 它实际上意味着一些东西,因此它将包含在可访问性树中,并将由屏幕阅读器宣布 - 作为一个,而不是一个控件。

If you would like to have a presentational box around each control, add some CSS borders to the wrapper divs you have used already.如果您希望每个控件周围都有一个展示框,请向您已经使用的包装 div 添加一些 CSS 边框。

It might make sense for all these controls to be inside a single fieldset with legend "Contact Info" or something like that.将所有这些控件放在带有图例“联系信息”或类似内容的单个字段集中可能是有意义的。

Then, use <label> elements with for attributes pointing at the id of the relevant control.然后,将<label>元素与指向相关控件 ID for属性一起使用。 Typically, the label will appear just before or after the control (or its wrapper div) in the DOM.通常,label 将出现在 DOM 中控件(或其包装器 div)之前或之后。

The for attribute is how the screen reader knows which label is associated with which control. for属性是屏幕阅读器如何知道哪个 label 与哪个控件相关联的。 With the for attribute in place, you can (and should) remove the aria-label attributes entirely.有了for属性,您可以(并且应该)完全删除aria-label属性。 It's always better to use the onscreen label as the accessible name, if possible.如果可能,最好使用屏幕上的 label 作为可访问的名称。

BTW why are your buttons marked as presentational?顺便说一句,为什么你的按钮被标记为演示? Why not use semantic HTML instead of ARIA?为什么不使用语义 HTML 而不是 ARIA? You've used <fieldset> and <legend> , why not <select> ?您使用过<fieldset><legend> ,为什么不用<select>

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

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