控制屏幕阅读器表单行为

时间:2017-11-06 09:59:42

标签: angular accessibility jaws-screen-reader

我的角度2应用程序

中有输入字段的跟随表单
<form class='wrapper' [formGroup]='form' novalidate #f='ngForm' role='form'>
<div class='content-row background-form-group'>
    <div [ngClass]="{'has-error': (validationOptions.submissionTried  && 
    bisDatumVorVonDatum())}">
        <input-field-group [overview]='options.overview'
                [validationOptions]='validationOptions'
                [eingabeOptions]='eingabeVonEingabeOptions' [form]='form' 
      (onChange)='onChangeHandler($event)'
                (onFocus)='onFocusHandler($event, 
      eingabeVonEingabeOptions)'>
        </input-field-group>
    </div>
    <div [ngClass]="{' has-error': (validationOptions.submissionTried && 
     (bisDatumVorVonDatum() || bisDatumNachStichtag()))}">
        <input-field-group [overview]='options.overview'
                [validationOptions]='validationOptions'
                [eingabeOptions]='eingabeBisEingabeOptions' [form]='form'
                (onFocus)='onFocusHandler($event, 
     eingabeBisEingabeOptions)'>
        </input-field-group>
    </div>
    <div [ngClass]="{'has-error': (validationOptions.submissionTried  && 
     bisDatumNachStichtag())}">
        <div *ngIf="dataCache.inBearbeitung.typ==='FAMILIENKASSE'">
            <input-field-group [overview]='options.overview'
                    [validationOptions]='validationOptions'
                    [eingabeOptions]='stichtagEingabeOptions' [form]='form'
                    (onFocus)='onFocusHandler($event, 
          stichtagEingabeOptions)'>
            </input-field-group>
        </div>
    </div>
    <div class='col-md-12 has-error'>
                <span id='bisDatumVorVonDatum-FehlerText'
                        *ngIf='validationOptions.submissionTried  && 
     bisDatumVorVonDatum()'
                        data-col='#E2001A'>{{bisDatumVorVonDatumErr}}</span>
        <span id='bisDatumNachStichtag-FehlerText'
                *ngIf='validationOptions.submissionTried && 

    bisDatumNachStichtag()'
                data-col='#E2001A'>{{bisDatumNachStichtagErr}}</span>
    </div>
</div>
</form>

当页面加载时,JAWS 18屏幕阅读器开始逐个读取输入字段。我想控制此行为,以便屏幕阅读器提到表单,然后停止。为此,我在表单标签中尝试了role =“form”,但这不起作用。我怎样才能达到这个目标?

1 个答案:

答案 0 :(得分:2)

抱歉,但你不能这样做,你不应该这样做 您可以传达一些信息,您可以隐藏或向屏幕阅读器显示元素,您可以将标题伪装成按钮,但是您无法停止屏幕阅读器以自动阅读页面。当用户点击您的页面时,JAWS开始大声朗读该页面(可以在JAWS 2018中关闭)。绝不应该阻止用户阅读您的内容。而且,基本上,你不能 如果您尝试实现其他目标,请更新您的问题。