Unable to test contrast of nodes scrolled out of view
See original GitHub issueThis problem was introduced in axe-core 4.5. When an element is scrolled out of view, it is not included in the grid, which results (among other things) that it is reported as incomplete once its scrolled out of view.
Here’s how to reproduce the problem. These logs should report the same, but the second one reports incomplete instead of a violations.
<h1 style="color: #ABC">Hello World</h1>
<main style="background: #CDF; height: 800px;"></main>
<script src="/axe.js"></script>
<script>
window.onload = async () => {
window.scrollTo(0, 0);
const res0 = await axe.run({ runOnly: 'color-contrast' })
console.log({ violations: res0.violations, incomplete: res0.incomplete })
window.scrollTo(0, 1000);
const res1 = await axe.run({ runOnly: 'color-contrast' })
console.log({ violations: res1.violations, incomplete: res1.incomplete })
}
</script>
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Blender Shader Nodes Training 1.4 - Navigation and Selection
comBlender shader nodes tr... ... Your browser can't play this video. ... 18K views 3 years ago Blender Shader Nodes Training.
Read more >can't see material nodes in node editor
Just found my answer. Ctrl + F in the Node Editor brings up a search menu. Save this answer. Show activity on this...
Read more >Text has minimum contrast[proposed] | ACT Rule | WAI
Description. This rule checks that the highest possible contrast of every text character with its background meets the minimal contrast requirement.
Read more >axe-core/CHANGELOG.md at develop
Accessibility engine for automated Web UI testing. ... create-grid: include elements scrolled out of view in the grid (#3773) (a563263) ...
Read more >ReactJS change color of element on scroll and when ...
Try this: import React from 'react' export default class Div extends React.Component{ state = { color: 'white' } listenScrollEvent = e ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dbjorge this is expected. @straker made a number of improvement that allowed us to better detect when things are off screen / clipped. It sounds like that’s what’s going on here.
Validated with the latest code base of axe-core develop branch, test-snippet:
even after scrolled,
color-contrast
rule failing in this situation, which is expected