-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Keyboard reordering with ngRepeat drops cursor in Voiceover on OSX #14677
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When a list rendered with ng-repeat
(which uses $animate
and jqLite under the hood) is reordered with the keyboard and OSX Voiceover is running, the screen reader cursor becomes detached from the browser's focus state in Safari, Chrome and Firefox. This happens when the underlying data object is manipulated, triggering a re-render; Voiceover can't seem to keep up with the changes, even with focus management (focus sent into the new item). The super buggy part is that it only happens some of the time, as you'll see in the screencast below.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
I recorded a screencast demoing the problem: https://www.youtube.com/watch?v=hqd4ZgQMuK0
Here is the demo code: http://codepen.io/marcysutton/full/RaOPLB
To reproduce:
- Open the page in Safari, Chrome or Firefox on a Mac and turn on Voiceover (using command + F5).
- Tab onto one of the reorder buttons.
- Hit an arrow key to reorder up or down.
What is the expected behavior?
Voiceover should follow the browser's focus point.
What is the motivation / use case for changing the behavior?
ng-repeat
is the standard way to render a list to be reordered, yet Voiceover can't keep up. This very well could be a Voiceover platform bug but I wanted to file it here for tracking purposes.
Compare the demo above with another one that does work in Voiceover (but does not use Angular): http://codepen.io/marcysutton/pen/dMEBEr?editors=1010
That demo manipulates the DOM using insertBefore
and then updates the data model, instead of the other way around. Voiceover has no problem keeping up with the DOM changes and works with the bare arrow keys (no modifier keys required). Both demos work in JAWS and NVDA on the Windows platform.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Mac OSX 10.11.4 (El Capitan) and Voiceover in Safari, Chrome and Firefox. I can test it with other versions of Angular too, but it happens with 1.5.5.
Other information (e.g. stacktraces, related issues, suggestions how to fix)
If we can't determine a fix here, my plan is to isolate the problem with the underlying raw DOM calls and file the bug with Apple. I spoke with @matsko about it since he knows a lot about $animate, which ng-repeat
uses to manipulate the DOM. But my client's giant Angular app needs reordering with ng-repeat
, so I'm hoping to find a workaround.