Search code examples
angularjsaccessibilitynvda

can't click with enter key when nvda is off


I started working with NVDA on a angular JS application to make it more accessible. In the website there are some ng-click activated components (spans/div/articles). When I turn on NVDA screen reader the navigation works fine and I can use the enter key to click on focused element. However when the screen reader is off the navigation with the tab key still works fine, but the enter key does not work anymore. Is there a reason/solution to this?


Solution

  • NVDA and Jaws simulate a mouse click when pressing enter, this is a feature of both screen readers to fight against the general lack of accessibility on most websites.

    You need to react to keyboard events yourself if you want your component to activate upon pressing enter for everyone regardless of if they are running a screen reader or not.

    However, the best would be to use an element that can be naturally focusable, such as <a> or <button> whenever possible, rather than <span> or <div>. Elements that are naturally focusable indifferently react on clicks and on enter key without the need to define anything.