fix(q-layout): Update scroll regardless of scroll prevented #12994 #13075
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.
Fixes #12994
Problem as I described in my issue is due to the fact the loading plugin uses the prevent scroll plugin. Due to this if the loader is ever active when a scroll event would be triggered the scroll position change would be ignored. This issue was specifically a problem for me clicking on a button at the bottom of a long page which then redirected to a page with no scroll. My pages uses the loading plugin and suspense to show a global spinner and the next page is loaded. In this scenario since I use the reveal header prop when I am scrolled all the way down to click on the navigation button, the header is hidden. Then the loader appears and sets prevent scroll true, scroll event fires since page body has changed and it isn't long enough to need a scroll bar. Due to the previous steps the header never reappears since the prevent scroll true is preventing the updating of the scroll object it is watching.
As I mentioned in my issue I couldn't consistently reproduce this outside of my applications environment. Seems to be a very specific race condition which are always fun to try and reproduce. Hope I described it thoroughly enough so the problem can be easily seen just by code inspection alone.
Alternative solution to this problem would be to only update scroll if it has a changed value when scrolling is prevented but not sure if that is really any better then always updating it on change event. Open to other possible ways to fix my scenario, figured I would make a PR for mine since my issue wasn't getting any response.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
dev
branch (orv[X]
branch)fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: