cant figure out position : sticky in a react component
i have a react component thats basically divided in two section i want the left section that is heading to stay sticky until the section ends i tried putting position : sticky but its not working can someone take a look what im doing wrong
2 Replies
You may need to give the element that you want to be sticky an align-self start. Didn't open your files but it's a common issue that their height is stretching. Try inspecting to see how tall it is or putting a bg or outline on it to see what the actual box looks like.
Otherwise make sire you're giving position sticky but also a top: 0
I dont see any position sticky in your css.
You could make a minimal reproduction in codepen with react or code sandbox so we actually know which elements corresponding to the classes in the css. Not your whole project just enough code to reproduce the issue ✨️