fix: prevent version selection reset when loading more releases#571
Open
al3rez wants to merge 1 commit intoDavidoTek:mainfrom
Open
fix: prevent version selection reset when loading more releases#571al3rez wants to merge 1 commit intoDavidoTek:mainfrom
al3rez wants to merge 1 commit intoDavidoTek:mainfrom
Conversation
Contributor
When clicking 'Load more...' to fetch additional releases, the version dropdown would show a blank selection after removing the 'Load more...' item and adding new versions. This fix saves the current selection index before removing the last item and restores it after adding new releases, ensuring the user's selected version remains visible during pagination.
9281148 to
1e05d23
Compare
Author
|
@sonic2kk i updated the solution the selection works now but it kind of jumps |
Contributor
|
Tested again and I think I understand what you mean about jumpy. When a version is selected, even the default version, clicking "Load more..." will cause it to switch to another version. It seems to be offset by its position in the list e.g. the default currently of the latest GE-Proton10-13 will jump to GE-Proton8-21 when "Load more..." Is pressed. This is the first suggestion on the next "page" of results. We may need to do some calculation on the selected index as well then. I haven't dug too deeply. |
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.


Summary
Problem
When users clicked "Load more..." to fetch additional releases, the version dropdown would reset to the first item (index 0), losing the user's current selection. This was frustrating when browsing through multiple pages of releases.
Solution
Added a check to only set
setCurrentIndex(0)whenloaded_page == 1(initial load). This preserves the user's selected version when loading additional pages.Test plan