Green overlay ontop of moderation button not accounted for on initial project load
Please confirm the following.
- [x] I checked the existing issues for duplicate problems
- [x] I have tried resolving the issue using the support portal
What browsers are you seeing the problem on?
Firefox
Describe the bug
If you load one of your own projects the green overlay that shows when a button is selected expands to the right causing it to fill other un-selected buttons.
Steps to reproduce
- Open a project that you own
- Observe the green button overlay expand to the right as the
moderationbutton is added conditionally
Expected behavior
Green overlay should not overlap multiple buttons
Additional context
Yeah the overlay also seems to be offset on some buttons, so when I click gallery it's over changelog, when I click changelog it's over versions, etc., and then for moderation it's over gallery.
Oh yeah I also get those
Mine looks slightly different:
I assume this is related to https://github.com/modrinth/code/issues/5226 (cc: @IMB11)
That looks like a different issue. I think this is unique because it's not related to the green overlay overlapping the wrong button the issue is it's overlapping multiple buttons at once which shouldn't happen.
I tried to fix this issue, which seems to be caused by dynamically inserted Gallery and Moderation tabs.
I rewrote the getTabElement function to no longer depend on the tabLinkElements reference array, but instead query the DOM directly within the scrollContainer to find the tab at the specific physical index.