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

Try horizontal collapse, but not working right now #31681

Closed
wants to merge 3 commits into from
Closed

Conversation

mdo
Copy link
Member

@mdo mdo commented Sep 17, 2020

Trying to implement https://www.codeply.com/go/UiteY92ke8/bootstrap-4-horizontal-collapse, but hitting my head against a wall for too long. Hoping someone on @twbs/css-review can point out the error of my ways.

Preview: https://deploy-preview-31681--twbs-bootstrap.netlify.app/docs/5.0/components/collapse/#horizontal

@ffoodd
Copy link
Member

ffoodd commented Sep 17, 2020

Isn't some JavaScript involved here? I see you only changed the Sass part.

@mdo
Copy link
Member Author

mdo commented Sep 17, 2020

Isn't some JavaScript involved here? I see you only changed the Sass part.

Most of the guides I've seen online don't change any JS, just CSS. Not quite sure if I'm missing some changed JS in that linked example, but you could very well be right.

@mdo mdo mentioned this pull request Sep 19, 2020
@XhmikosR
Copy link
Member

XhmikosR commented Oct 1, 2020

The demo don't seem to use any JS apart from the core classes. Not sure if we have changed those in v5, since the demo is using v4.1.3. I also tried the demo with v5.0.0-alpha1 and seems to work fine, so I'd say something is missing in the CSS or markup?

@XhmikosR
Copy link
Member

XhmikosR commented Oct 1, 2020

BTW this whole thing is transitioning properties that are not performant, like width and height.

Here is a Codepen with v5.0.0-alpha2: https://codepen.io/XhmikosR/pen/wvGLgwv?editors=1100

EDIT: this change breaks all current collapse; see the docs navbar which doesn't show, or the docs sidebar which doesn't scroll vertically

@Flarescape

This comment has been minimized.

@mdo
Copy link
Member Author

mdo commented Mar 18, 2021

I give up lol

@mdo mdo closed this Mar 18, 2021
@XhmikosR XhmikosR deleted the horizontal-collapse branch March 18, 2021 07:00
@alpadev
Copy link
Contributor

alpadev commented Mar 26, 2021

I give up lol

Nooo.. Don't!😯Let's collaborate then.

I think you don't need that visibility stuff. There are two things that are involved.

First the collapse module checks for a width class on the collapse element. 🤯

Second magic thing is there is some hardcoded width in that demo. Not sure if it's possible to make this responsive without JS.

Also I'm not sure why that demo got that visibility stuff. My guess is that you can't transition display but visibility. For what reason? I don't know. If I remove that visibility stuff the demo works the same as for me.

This leaves us with something like that: https://codepen.io/-alpa-/pen/yLgObPM

Edit: I have no use case for this, but if you really want that feature I will try to help you here. If not maybe you should close #17496 as well.

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

Successfully merging this pull request may close these issues.

5 participants