[system] Fix mode blink when open multiple sessions#33877
Merged
siriwatknp merged 10 commits intomui:masterfrom Aug 24, 2022
Merged
[system] Fix mode blink when open multiple sessions#33877siriwatknp merged 10 commits intomui:masterfrom
siriwatknp merged 10 commits intomui:masterfrom
Conversation
siriwatknp
commented
Aug 15, 2022
…em/fix-css-vars-provider
siriwatknp
commented
Aug 15, 2022
| ); | ||
|
|
||
| expect(screen.getByTestId('current-mode').textContent).to.equal('dark'); | ||
| expect(global.localStorage.setItem.calledWith(customModeStorageKey, 'dark')).to.equal(true); |
Member
Author
There was a problem hiding this comment.
This is not necessary because the value is already dark.
siriwatknp
commented
Aug 15, 2022
| export default function DarkModeSpecificity() { | ||
| export default function ColorSchemeSelector() { | ||
| return ( | ||
| <CssVarsProvider modeStorageKey="dark-mode-specificity"> |
Member
Author
There was a problem hiding this comment.
no need to use a custom key because the storage is cleared between tests in test/regressions/index.test.js
…em/fix-css-vars-provider
…em/fix-css-vars-provider
mnajdova
approved these changes
Aug 23, 2022
daniel-rabe
pushed a commit
to daniel-rabe/material-ui
that referenced
this pull request
Nov 29, 2022
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.
Before
There is a flaw in using
React.useEffectin the code which causes the mode to switch back and forth between sessions.Screen.Recording.2565-08-15.at.12.47.33.mov
After
Screen.Recording.2565-08-15.at.12.53.10.mov
The tests already covered the common scenarios. This bug is a very edge case due to our documentation requirement.