Skip to content

FINERACT-2600: Fix theme toggle scrolling page to top on click#57

Merged
meonkeys merged 2 commits into
apache:asf-sitefrom
bagusrizkis:FINERACT-2600-fix-theme-toggle-scroll
May 27, 2026
Merged

FINERACT-2600: Fix theme toggle scrolling page to top on click#57
meonkeys merged 2 commits into
apache:asf-sitefrom
bagusrizkis:FINERACT-2600-fix-theme-toggle-scroll

Conversation

@bagusrizkis
Copy link
Copy Markdown
Contributor

Summary

Replace the theme toggle anchor (<a href="#">) with a <button type="button">, and reset background and border in CSS so the visual is identical to before.

Why

JIRA: FINERACT-2600

Clicking the toggle scrolled the page to top because href="#" triggered default anchor navigation. <button> is also semantically correct since the toggle doesn't navigate anywhere, and Space-key activation works for free.

Testing

Served locally and verified the bug reproduces with the original markup, then no longer reproduces after the change. Toggled multiple times across scrolled positions, theme switches in place. Visual rendering identical to before. Tested in Safari, Chrome, and Firefox.

@meonkeys
Copy link
Copy Markdown
Contributor

Thank you. I like this idea and I want it to toggle dark/light mode without scrolling.

When I click the theme toggle it's leaving an artifact/colored box in place. This repros in Firefox and Chromium. Will you see if you can get it to not create the artifact?

Before:

Screenshot from 2026-05-26 17-46-37

After, with artifact:

Screenshot from 2026-05-26 17-46-40

Comment thread site-src/layouts/partials/home-header.html
@bagusrizkis
Copy link
Copy Markdown
Contributor Author

Thanks for catching this.
Fixed in the latest commit

Copy link
Copy Markdown
Contributor

@meonkeys meonkeys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@meonkeys meonkeys merged commit 7daf4e6 into apache:asf-site May 27, 2026
2 checks 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.

2 participants