Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We introduced a bug in d5eb92b which caused Waypoints that listen to scroll events on the `window` object to fail. This was because we switched from parentNode to parentElement when traversing up the DOM tree. This in turn meant that on the way to `window`, we would now pass the `document` node. This node has no styles, and if you try calling `window.getComputedStyles` on it, it will return `null`. I've added a guard for this scenario that will bring back the desired behavior. While adding a spec, I noticed that a previous, seemingly unrelated, spec was suddenly failing. It was meant to test the fact that we explicitly throw an error if the offsetParent for the Waypoint node does not have positioning. This is done to help prevent unexpected behavior when using the Waypoint component. The spec for this however, wasn't catching the right error thrown. Instead it falsely caught the error for when the getComputedStyle was null. I looked for a way in Jasmine to make this spec better specify what error it wanted to catch, but I couldn't find anything obvious. Ideas for how to improve that spec are welcome.
- Loading branch information