Closed rajbirsingh83 closed 4 weeks ago
Looks like there are a couple minor linting errors.
The test failure isn't caused by your PR, but you can fix it by bumping this line to 18.20.4: https://github.com/elwayman02/ember-scroll-modifiers/blob/master/package.json#L101
Summary
Currently,
scroll-into-view
modifier scrolls the element into the viewport but does not move the focus to theelement
. As such, it causes accessibility issue when the trigger element (like a button on the page that setsshouldScroll
as true) is different from the modifier element, because the user sees the modifier element in the viewport but the focus remains on the trigger element (which might be out of viewport by now). So, the keyboard user has to navigate all the way from trigger element to modifier element.To avoid this issue and be accessibility compliant, we can allow consumers of the modifier to enable auto setting of focus on scroll-into-view:
Testing
$ yarn test
Screen recordings
using Mouse
https://github.com/user-attachments/assets/638065c8-6cec-4bfa-b2f3-e6f1724a594d
using Keyboard (Chrome)
https://github.com/user-attachments/assets/572dc40c-a307-47f4-b7a6-4d9da3091c58
using Keyboard (Safari)
https://github.com/user-attachments/assets/d786f0c4-df15-457c-8497-0438f56aad94