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

Fix: addon panel content is invisible for any addon listed after the interactions panel #19771

Merged

Conversation

interphased
Copy link
Contributor

Issue

Addon-panel content is invisible if the addon is listed after the Interactions panel. The addon content is in the DOM but hidden due to a style error. See: #17818

What I did

I removed the addon-panel transform style. This code was originally added as a hack to "prevent a bug where the content would be invisible." The original PR is here: #6759

I couldn't find any documentation about said bug, and the fix is over 3 years old. @ndelangen do you recall how to recreate that bug? Is it still an issue in modern browsers or with vite-builder? In my testing this transform fix has now become the cause. Removing the style override is the simplest way to resolve the issue.

How to test

  • [N] Is this testable with Jest or Chromatic screenshots?
  • [N] Does this need a new example in the kitchen sink apps?
  • [N] Does this need an update to the documentation?

To test, simply add any custom addon to Storybook and list is after the Interactions panel. See: #17818

Addon doesn't work:

image

Addon works when changing the order:

image

Addon works when disabling transform:

image

Alternatives

If we need to keep the translate hack, then we should consider adding height: 100% to the AddonPanel div style to ensure addons using relative heights will render. This would also be a sufficient fix.

Height fix:
image

@shilman
Copy link
Member

shilman commented Nov 8, 2022

Thank you @interphased !! @JReinhold mind taking a look at this one?

@JReinhold
Copy link
Contributor

Great job @interphased, thanks for hunting this down.
I've confirmed this to be an issue, and your fix to be working.

I'd prefer to go with the solution you proposed with removing the transform style.
But I want to confirm with @ndelangen that introduced it, if you can remember why it's there in the first place?
I've tested this out in Chromium, Firefox and Safari and they all seem to work without the transform hack, which is good enough for me.

@ndelangen
Copy link
Member

I do not recall a bug that happened 3 years ago that needed a CSS hack, sorry :(

@JReinhold JReinhold merged commit 9d49e82 into storybookjs:next Nov 18, 2022
@interphased
Copy link
Contributor Author

I do not recall a bug that happened 3 years ago that needed a CSS hack, sorry :(

I know it's a bit of a stretch. Sometimes I can't remember what I coded a few weeks ago. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants