-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Position sticky inside collapse #309
Comments
Do you have a reproducible case in codepen to play with? |
I had no time to make one, but I already found a fix for it, I can do a pull request. Fact is that the component was calling onResize on every component update, with having dynamic content in your collapse then overflow is switching back and forth so the sticky element flickers as well. I'm doing a check on my fork for
|
How would I test it then? |
Yeah sorry, thought the explanation was pretty clear, I'll try to make a repo with it when I have time. Question is do you want the collapse to have a fluid growth with dynamic content inside it? If yes, then why? Shouldn't the developer handle that on it's own? IMO this component should only be applying overflow hidden when the state changes from open to closed. Also it is a performance issue if you call the resize function on each update. |
Don't think I get your point. |
All right, got ya. Just wanted to make sure that this is how you want it to work. In this case, we need to find a way of doing it in order to avoid this
https://developer.mozilla.org/en-US/docs/Web/CSS/position Doing this inside the work function at every timeout causes a flickering for a position sticky inside collapse |
I suggest not to use |
Hmm, not true, you can have content that is loading async when opening the collapse and then you don’t know the height. I wanted to use it in a section on a landing page that basically contains an mvp for an app. anyway, seems that it is beyond the scope of the lib, I will try to find some time and make a pull request for sticky. Meanwhile I think we can add a note in the project description for people to know about weird component interaction with position sticky. |
Use case: Have one container for 3 divs(A,B,C) inside the collapse. Two of them(A,B) are being displayed based on a state property. Component C is a sticky one.
Whenever the state changes -> the collapse re-rendering causes a quick change between overflow: hidden and overflow: initial. The quick overflow change causes the sticky component (C) to flicker to offset and back.
No props are being changed on the collapse itself during this process.
The text was updated successfully, but these errors were encountered: