Skip to content

Legend focus causes unexpected scrolling when container is scaled and accessibility is enabled #16497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pvsleeper opened this issue Oct 15, 2021 · 0 comments · Fixed by #16743
Labels
a11y Accessibility related. Type: Bug

Comments

@pvsleeper
Copy link

Expected behaviour

When the legend receives focus, the chart should not scroll out of view.

Actual behaviour

When focusing on a legend and a scaling transform is applied, the chart scrolls half way out of view.

This is probably a strange use case, but we do use a scaling transform in our product which unfortunately results in this behaviour. From what I can tell, the root cause is because the "proxy" buttons that gets created is usually located exactly on top of the legend item. When a scaling transform is applied, it seems to be calculating its position incorrectly. This button is the actual element that receives focus, and the browser thinks the thing its focusing is outside of the viewport and tries to scroll it into view for you, causing this issue.

Live demo with steps to reproduce

https://jsfiddle.net/bfuLdo5n/15/

Product version

9.2.2

Affected browser(s)

Google Chrome, Edge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility related. Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants