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

refactor(openClose): use the correct property to specify open/close transition prop #11286

Merged
merged 4 commits into from
Jan 15, 2025

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Jan 13, 2025

Related Issue: N/A

Summary

Updates open/close components to use the correct transition property.

Notes

  • this was working as expected because the property wasn't being used correctly
  • makes openProp optional and defaults to open when not specified
  • updates types to ensure CSS props are specified by transitionProp
  • renames openTransitionProp to openProp to avoid confusion with CSS transitions

@Elijbet Thanks for spotting this one!

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Jan 13, 2025
@jcfranco jcfranco changed the title fix(openClose): fix regression that caused the transition prop to monitor to be ignored refactor(openClose): use the correct property to specify open/close transition prop Jan 13, 2025
@github-actions github-actions bot added the refactor Issues tied to code that needs to be significantly reworked. label Jan 13, 2025
@jcfranco jcfranco requested a review from Elijbet January 13, 2025 23:55
@jcfranco jcfranco added the skip visual snapshots Pull requests that do not need visual regression testing. label Jan 15, 2025
@jcfranco jcfranco marked this pull request as ready for review January 15, 2025 00:58
@@ -38,7 +37,7 @@ export interface OpenCloseComponent {
}

function isOpen(component: OpenCloseComponent): boolean {
return "opened" in component ? component.opened : component.open;
return component[component.openProp || "open"];
Copy link
Contributor

Choose a reason for hiding this comment

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

Great! This will cover expanded/collapsed/closed states as well.

@jcfranco jcfranco merged commit 8c09c74 into dev Jan 15, 2025
14 checks passed
@jcfranco jcfranco deleted the jcfranco/fix-open-close-bug branch January 15, 2025 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. refactor Issues tied to code that needs to be significantly reworked. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants