Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbars: Fix title behavior in UI #22496

Merged
merged 4 commits into from
May 10, 2023
Merged

Toolbars: Fix title behavior in UI #22496

merged 4 commits into from
May 10, 2023

Conversation

shilman
Copy link
Member

@shilman shilman commented May 10, 2023

Closes N/A

Reported here https://discord.com/channels/486522875931656193/1105749672489918506

What I did

There's a bug in Storybook 7 where the toolbar button automatically shows a text label even if no title is specified in the toolbar configuration. It also makes a deprecation warning in the console. This PR fixes that. Now if the user doesn't specify a title attribute for the toolbar, no label is shown, and no deprecation warning is shown.

It also fixes a few other minor bugs in the same code:

  • If no title or icon is specified, it will warn in the browser console
  • If the user uses a reset toolbar item
    • it won't show the reset label when dynamicTitles is set
    • it won't show a react duplicate key warning in the browser console

Self-merging @valentinpalkovic

How to test

Run a sandbox and check out the toolbar. In the current code both Theme and Locale will show up as labels. With this PR, the Locale label goes away since it's not configured in the project.

@shilman shilman added bug addon: toolbars patch:yes Bugfix & documentation PR that need to be picked to main branch labels May 10, 2023
@shilman shilman merged commit fc0e40f into next May 10, 2023
@shilman shilman deleted the shilman/toolbars-fix-title branch May 10, 2023 11:59
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 12, 2023
shilman added a commit that referenced this pull request May 12, 2023
@shilman shilman mentioned this pull request May 12, 2023
@gilbarbara
Copy link

Yes! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: toolbars bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants