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

[Collapse] Support collapsing horizontally (x-axis) #3321

Open
sentilesdal opened this issue Jan 29, 2019 · 5 comments
Open

[Collapse] Support collapsing horizontally (x-axis) #3321

sentilesdal opened this issue Jan 29, 2019 · 5 comments

Comments

@sentilesdal
Copy link

Environment

  • Package version(s): 3.12.0
  • Browser and OS versions: Chrome 71

Feature request

Allow the <Collapse/> to collapse horizontally.

Examples

One idea: pass in the dimension you wish to transition on

export interface ICollapseProps extends IProps {
  ...
  /**
   * The dimension of the  child component to apply the transition.
   * @default "height"
   */
  transitionDimension?: 'height' | 'width';
  ...
}

and then deciding throughout which dimension to capture and which transition to apply.

@sentilesdal
Copy link
Author

sentilesdal commented Jan 29, 2019

I would be happy to submit a PR if someone would give some direction on how they'd prefer to see this implemented. i.e. would you like to see a boolean flag used instead for the API:

export interface ICollapseProps extends IProps {
  ...
  /**
   * If true, transitions along the x-axis.
   * @default false
   */
  horizontal?: boolean;
}

@giladgray
Copy link
Contributor

@sentilesdal definitely down for this. we use an opt-in vertical prop (default false) on other components (ControlGroup, ButtonGroup) so it would be cool to maintain that consistency, but it's very awkward that the default here would be vertical=true and you'd have to set vertical={false} for this behavior. so i guess i'm open to the API being horizontal={true}. either way, definitely just a boolean prop.

i'd be delighted to review a PR for this! if, in your travels, you want to clean up the Collapse code, that would be greatly appreciated and encouraged. 👏

@giladgray giladgray changed the title <Collapse /> - Support collapsing horizontally (x-axis) [Collapse] Support collapsing horizontally (x-axis) Jan 30, 2019
@sentilesdal
Copy link
Author

@giladgray Sounds good. I'm going to try to find time this weekend to get this implemented. =)

@RonnyO
Copy link

RonnyO commented Feb 23, 2020

Hey @sentilesdal, any chance you started work on this? I need this as well, so if you didn't start yet perhaps I will 🙂

@sentilesdal
Copy link
Author

@RonnyO no i haven’t. Feel free!

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

No branches or pull requests

3 participants