angular / preboot

Coordinate transfer of state from server to client view for isomorphic/universal JavaScript web applications
MIT License
382 stars 51 forks source link

Setting Focus is not applying to screenreader elements, only TextArea and Input elements #105

Closed josephliccini closed 5 years ago

josephliccini commented 5 years ago

Note: for support questions, please use the Universal Slack Channcel or https://gitter.im/angular/universal

Users who use screenreaders use the browser focus for many other different elements on the page, and rely on the focus on those elements, along with the screenreader, to announce where they are on the app.

If a screenreader user tabs through an <a> tag, for example, on the Server View, the Client View will not set focus.

josephliccini commented 5 years ago

Note, I can easily fix this by removing the CARET_ELEMENTS check in Preboot. I can submit a PR if desired.

josephliccini commented 5 years ago

Thanks @CaerusKaru !

Recommendations on how write a test for this change in this repo?

CaerusKaru commented 5 years ago

@josephliccini What kind of test change are you thinking about?

josephliccini commented 5 years ago

Something like: "focus on a server element" preboot performs swap "assert focus on correct element"

CaerusKaru commented 5 years ago

Take a look at the integration tests here. It should be straightforward to add, thanks!