Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: JS error in @axe-core/react caused by stale reference to heading
Noticed a small bug when testing out a newer version of @axe-core/react (we were on a pretty old version of react-axe), we have a case where a heading gets removed during an animation and it seems that heading-order-after is called with a stale result such that when trying to find it's index in the heading order it can't be found and we see a error in the console like `TypeError: Cannot read property 'level' of undefined`. This is a simple naive fix to not use the index if it is -1, but I'm happy to try a different strategy if somebody with more context has a better one!
- Loading branch information