Skip to content

Commit

Permalink
Merge pull request #2950 from agreene-coursera/patch-1
Browse files Browse the repository at this point in the history
FIX: JS error in @axe-core/react caused by stale reference to heading
  • Loading branch information
dylanb authored May 20, 2021
2 parents 1c53c20 + e2e64e4 commit 20d89c0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/checks/navigation/heading-order-after.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ function headingOrderAfter(results) {
return heading.ancestry === path;
});
const index = headingOrder.indexOf(heading);
headingOrder.splice(index, 1, {
level: headingOrder[index].level,
result
});
if (index > -1) {
headingOrder.splice(index, 1, {
level: headingOrder[index].level,
result
});
}
});

// remove any iframes that aren't in context (level == -1)
Expand Down

0 comments on commit 20d89c0

Please sign in to comment.