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
Position fixed elements inside <Sidebar.Pushable> #2897
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
@DHDaniel it still flickers even after I set |
@andrew-oko-odion I only set Perhaps make sure that there aren't any other pesky transforms in any of your parent containers. Also, my problem was not that it flickers, but that it jumps of the screen completely (disappears and gets absurdly large x and y coordinates). If it's flickering but still scrolling and staying on screen, the issue may be somewhere else. |
Can confirm this, and that setting
|
Warning was added in #2936. |
@DHDaniel thanks you guy! I look it so long. |
This gist illustrates what appears to be a complete solution to the problem. It's easy to implement and should adapt well to most implementations. |
Feature Request
Problem description
I'm developing an app with the awesome pushable sidebar Semantic UI component. Inside the app (i.e inside the display that is 'pushed') I wanted to have a sticky component that becomes fixed when scrolling. However, the
<Sticky>
Semantic UI component was not working - on scrolling, it seemed to jump off the screen completely. I spent ages (at least a whole day) trying to figure out why it wasn't working, and even tried to implement my own solution, to see if it was a bug with<Sticky>
. However, after scourging the web for hints, I finally discovered the problem.The
<Sidebar.Pushable>
component adds atranslate3d()
CSS transform to the div it renders as. Essentially, this means that the coordinate system becomes warped, and you can no longer use fixed positioned elements inside the parent that was transformed. This means that<Sticky>
does not work inside a<Sidebar.Pushable>
element (or anyposition: fixed;
element, for that matter).Proposed solution
I eventually solved it by setting
transform: none;
on the<Sidebar.Pushable>
element using my own CSS, noticing that the pushable sidebar was still working even after taking it away. Hence, I can think of two solutions:<Sidebar>
component that indicates fixed positioning will not be available inside it - after all, I was not aware that the<Sidebar>
component was applying any transforms, or that those transforms rendered fixed positioning unavailable.transform
property from<Sidebar.Pushable>
altogether. I'm not sure if this has any performance impacts, but it did solve my issue. I had to do it manually, but perhaps it could be removed by default to save some headaches. Alternatively, a prop could be passed enabling or disabling transforms.Either way, I think the documentation should make it clear that
position: fixed
elements will not work as desired inside components that have been transformed.The text was updated successfully, but these errors were encountered: