What are the accessibility implications of using a framework like angularjs?

前端 未结 3 1897
梦毁少年i
梦毁少年i 2020-12-02 11:50

Where we stand

We are under a push for web accessibility in order to conform to certain laws governing public/educational institutions. Until now we\'ve been gett

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 12:10

    Your biggest issues with AngularJS and accessibility will be:

    1. Focus management - as soon as your route causes a section of content to be updated and that section contains the focus, the browser will send focus to the top of the document and screen reader and keyboard-only users will get lost. You will have to actively manage your focus
    2. Announcements of dynamic updates - data binding allows updates to occur to the DOM with no interaction with your JavaScript. If these updates are important, the screen reader users will have to be informed about these updates using aria-live regions. Getting these to work properly - especially on iOS will be tricky.
    3. Form validation - the AngularJS example all use elements for the error messages that get displayed when form validation fails. None of the associations are correct with the input fields and the same issues as mentioned under #2 will have to be addressed if displaying these automatically (especially when done using blur)
    4. title attribute updating - when your router changes your URL, you should be updating the title of the document

    Other than that, it is just another HTML application.

    This Github repo has some Angular.js directives and services for dealing with some of these problems https://github.com/dequelabs/ngA11y

提交回复
热议问题