Merge pull request #20818 from magicismight/patch-1

fix: outline initial state
This commit is contained in:
Jeppe Reinhold 2023-02-02 09:51:39 +01:00 committed by GitHub
commit 716eeef7f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ export const OutlineSelector = memo(function OutlineSelector() {
const [globals, updateGlobals] = useGlobals(); const [globals, updateGlobals] = useGlobals();
const api = useStorybookApi(); const api = useStorybookApi();
const isActive = globals[PARAM_KEY] || false; const isActive = [true, 'true'].includes(globals[PARAM_KEY]);
const toggleOutline = useCallback( const toggleOutline = useCallback(
() => () =>

View File

@ -7,7 +7,7 @@ import outlineCSS from './outlineCSS';
export const withOutline = (StoryFn: StoryFunction<Renderer>, context: StoryContext<Renderer>) => { export const withOutline = (StoryFn: StoryFunction<Renderer>, context: StoryContext<Renderer>) => {
const { globals } = context; const { globals } = context;
const isActive = globals[PARAM_KEY] === true; const isActive = [true, 'true'].includes(globals[PARAM_KEY]);
const isInDocs = context.viewMode === 'docs'; const isInDocs = context.viewMode === 'docs';
const outlineStyles = useMemo(() => { const outlineStyles = useMemo(() => {