Closed wandanli closed 3 years ago
If use sticky
, the container of the sticky item needs to be scrollable, for this situation, the container should be the body
.
But the PageButton
need to be the sub-component of the Plants
.
And after searching, I think it should use sticky
if the sticky item needs to be shown and disappeared with its container, otherwise, use fixed
if the item needs to keep showing.
So use fixed
.
For more information about fixed and sticky, see https://codepen.io/wandanli/pen/yLgYxjJ
https://www.kevinpowell.co/article/positition-fixed-vs-sticky/
The page button could not stay at the same position after setting
position:sticky