fix: resolve theme toggle issues across web and legacy generators#734
Closed
devprakash93 wants to merge 1 commit intonodejs:mainfrom
Closed
fix: resolve theme toggle issues across web and legacy generators#734devprakash93 wants to merge 1 commit intonodejs:mainfrom
devprakash93 wants to merge 1 commit intonodejs:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
|
Duplicate of an already open PR. |
Member
|
Thanks for your PR @devprakash93. Unfortunately, it's already been tackled here: #656 |
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.
Description
Resolves "Theme Toggle Not Working" issues reported across both the Web and Legacy generators, caused by two separate regressions:
The
@node-core/ui-components/Common/ThemeTogglecomponent recently updated from a binary toggle to a 3-state dropdown (light,dark,system).NavBar.jsxanduseTheme.mjswere still using an<button onClick>approach rather than the newonChange(theme)prop. This caused clicking the button to blindly cycle themes and immediately close the dropdown while rejecting the"system"state.useTheme.mjsto export achangeTheme(newTheme)callback instead oftoggleTheme(). UpdatedNavBar.jsxto pass the correctonChangeandcurrentThemeprops.In the legacy HTML generated pages, clicking the theme toggle wasn't working specifically on Firefox. The click specifically on the inner SVG icons was failing to bubble optimally to the
<button>event listener.pointer-events: noneto the.theme-toggle-btn svginstyle.cssso clicks correctly tunnel straight to the<button>element. Also addedtype="button"defensively to avoid unintended form-submission behaviors.Validation
ThemeTogglecorrectly sends the chosen state (light,dark,system) throughonChangetouseTheme.pointer-events: nonelogic for SVGs enforces native<button>click handling consistently across Firefox.npm run test).Related Issues
Fixes Theme Toggle Not Working.
Check List
node --run testand all tests passed.node --run format&node --run lint.