Skip to content

Fix selection and scroll amount not restoring in mod list#1041

Merged
gniftygnome merged 1 commit into
TerraformersMC:26.2from
fishstiz:fix-selection-and-scroll-not-restoring
Jun 13, 2026
Merged

Fix selection and scroll amount not restoring in mod list#1041
gniftygnome merged 1 commit into
TerraformersMC:26.2from
fishstiz:fix-selection-and-scroll-not-restoring

Conversation

@fishstiz

Copy link
Copy Markdown
Contributor

Fixes #1020

The commit 5e16dfa broke the fix on #837 since selecting an entry also scrolls to that entry on AbstractSelectionList since Minecraft 1.21.9

Passing true to reposition when reloading filters on ModListWidget#finalizeInit already ensures that either the last selected or the first entry will be selected, and finalizeInit will restore the scroll amount anyway.

@gniftygnome

Copy link
Copy Markdown
Contributor

Still need to test opening ModMenu and immediately clicking the Config button (reversion).

@gniftygnome

gniftygnome commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

OK this tests out good as far as I can tell. Selections are retained where they should be and I haven't found a way to get a Config button when I shouldn't.

Judging from the summary, this needs backported through 1.21.9.

@fishstiz

fishstiz commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Well i found a way to make selected null if you make all mods hidden through the config but i'm not sure if thats relevant for this PR since I can do that before the reposition check and the "ensure valid entry is selected logic" was added, as far back as 1.21.1, and it just crashes instantly in versions prior.

@gniftygnome

Copy link
Copy Markdown
Contributor

as far back as 1.21.1, and it just crashes instantly in versions prior.

OK, I think that's a separate issue. It would be cool to fix but I'm not sure what I'd do. Maybe display some dummy entry instead ("mods goes here my mans")? Or just forcibly exempt ModMenu itself from being excluded from the visible mods...

@gniftygnome gniftygnome merged commit 85201ef into TerraformersMC:26.2 Jun 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selection switches upon seeing link prompt/config

2 participants