Repository navigation
[BUGFIX] Follow spotlight targets that scripts move while scrolling - #164
Merged
Merged
Conversation
Since #161, the holes only followed the scrolling for sticky and fixed targets and targets in scroll containers. A class or style change of an ancestor only recomputed the holes when it started or stopped this. So targets that a script moves while scrolling, e.g. a parallax effect that sets a transform on a section, or a reveal effect that removes a class with an offset, kept their old holes, and the overlay covered them. 1.10.4 recomputed the holes on every scroll event and followed them. A class or style change of an ancestor of the targets recomputes the holes now, at most once per frame. Pages without such changes still run no code while scrolling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #161 and #162, before the next release.
Problem
Since #161, the spotlight holes only follow the scrolling for sticky and fixed targets and for targets in scroll containers. A class or style change of an ancestor of the targets only recomputed the holes when it started or stopped this. Targets that a script moves while scrolling kept their old holes, and the overlay covered them:
transformon a section while scrolling,1.10.4 recomputed all holes on every scroll event, so these targets stayed clickable there. #144 is not released yet, so this would be a regression in the next release.
Implemented behavior
Tests
spotlight-overlay.test.js(browser):stylewhile scrolling: the target stays clickable, the element next to it stays blocked. Fails without the fix, passes with the spotlight of 1.10.4.getBoundingClientRectcall while scrolling) and all other spotlight tests stay green.npm run test: 101 passing,npm run lint