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

Add onCollapsedChange prop for Doc Block #217

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

pocka
Copy link
Collaborator

@pocka pocka commented Oct 17, 2023

closes #216

Added onCollapsedChange property for DocBlockBase component, which is used by every Doc Block components.
This enables users (story authors) to persist collapsed state somewhere and restore it via defaultCollapsed property, in order to save users' screen estate.

I choose to use onObjectVerb naming style commonly used in DOM, but willing to change if official Storybook code/community has widely used style.

<#216>

This event callback enables users to save collapsed state and use it for
`defaultCollapsed` property. Having an event for changes is necessary as
the collapsed state is uncontrolled property.
@ghengeveld ghengeveld requested review from yannbf and removed request for ghengeveld October 25, 2023 07:25
Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! No specific naming style on the Story block side.

@yannbf yannbf merged commit 90597f0 into master Dec 1, 2023
3 checks passed
@yannbf yannbf deleted the feature/blocks-collapse-event branch December 1, 2023 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a prop like onToggle to Figma component?
2 participants