fix: reset scroll on ExtraParamsChanged by default #1423
Closed
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.
https://jira.kroger.com/jira/browse/DCPPERS-12567
Motivation and context
In the Playboard, we use the
ExtraParams
component (wrapped here). We often modify theseextraParams
programmatically.We recently discovered a "bug" that the scroll of the
ResultList
(which we also use) wasn't getting reseted, causing and extra request to the search endpoint (for the second page or results) and the incorrect results displayed in the list 😢The
ScrollMixin
component was already "listening" to theUserChangedExtraParams
event (triggered byRenderlessExtraParam
) and resetting the scroll of the scrollable element, but it wasn't "listening" to theExtraParamsChanged
event (triggered byExtraParams
).This PR basically adds
ExtraParamsChanged
to the "default" list of events that should cause the scroll to be reseted.Type of change
What is the destination branch of this PR?
Main
How has this been tested?
Tests performed according to testing guidelines:
I tested this manually by adding the following to
packages/x-components/src/views/home/Home.vue
:Without this fix (aka HOW TO REPRODUCE the issue):
With this fix:
Checklist: