Skip to content
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

Scroll position in shadow DOM is not restored after axe.run #1358

Closed
WilcoFiers opened this issue Feb 8, 2019 · 2 comments
Closed

Scroll position in shadow DOM is not restored after axe.run #1358

WilcoFiers opened this issue Feb 8, 2019 · 2 comments
Assignees
Labels
color contrast Color contrast issues core Issues in the core code (lib/core) fix Bug fixes
Milestone

Comments

@WilcoFiers
Copy link
Contributor

Like the title says. I found this while looking through getElmScrollRecursive. It only looks at the light tree, which means any scrollable regions in shadow trees will not be restored to their original scroll position after axe.run() completes.

@WilcoFiers WilcoFiers added fix Bug fixes core Issues in the core code (lib/core) labels Feb 8, 2019
@straker straker added this to the Axe-core 3.5 milestone Nov 19, 2019
@straker straker added the color contrast Color contrast issues label Nov 19, 2019
@straker straker self-assigned this Dec 17, 2019
@padmavemulapati
Copy link

padmavemulapati commented Feb 5, 2020

@steven for the testfile below:

<div id="fail1" style="height: 5px; overflow: auto;">
	<input type="text" tabindex="-1" />
</div>

<div id="fail2" style="height: 5px; overflow: auto;">
	<input type="text" tabindex="-1" />
	<select tabindex="-1"></select>
	<textarea tabindex="-1"></textarea>
</div>

<!-- inapplicable -->
<section id="inapplicable1">This element is not scrollable</section>

<div id="inapplicable2" style="height: 200px; width: 200px; overflow: auto;">
	<div style="height: 10px; width: 100x;">Content</div>
</div>

I am seeing the below behaviour..(attached screenshot), it is no longer scrolls the contents. Is this what we are expecting?

image

@straker
Copy link
Contributor

straker commented Feb 5, 2020

Yes the page should no longer scroll, but it doesn't look like there's a shadow DOM element in the test that has a scroll region.

<script>
const el = document.getElementById("inapplicable1");
const shadow = el.attachShadow({ mode: 'open' });
shadow.innerHTML = `<div style="height: 100px; overflow-y: scroll;">
  <div style="height: 1000px">This should stay on screen after running axe</div>
<div>`;
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
color contrast Color contrast issues core Issues in the core code (lib/core) fix Bug fixes
Projects
None yet
Development

No branches or pull requests

4 participants