gm0t / react-sticky-el

MIT License
257 stars 47 forks source link

"stickiness" not being activated #23

Open ThunderDev1 opened 6 years ago

ThunderDev1 commented 6 years ago

I tried a simple example

<Sticky>
    <div style={{background: 'red'}}>test</div>
</Sticky>

It seem to add the proper divs and styles

<div style="min-height: 20px;">
    <div class="" style="transform: translateZ(0px);">
        <div style="background: red;">test</div>
    </div>
</div>

But when I scroll nothing happens, the fixed class is not being added so my test div remains hidden. Are there any cases when this component does not work ? (like particular css in parent)

Thanks

gm0t commented 6 years ago

Hi @ThunderDev1! There shouldn't be any special cases... But there is always chance for bug :) Could you please provide more information or may be create some playground?

seyyed-sina commented 5 years ago

same issue here

flieks commented 4 years ago

same issue image

marharyta commented 4 years ago

Having the same issue here

gm0t commented 4 years ago

hey @marharyta, could you please provide a bit more examples on how you use it and what exactly is your problem? Also, which version are you using?

capi1O commented 3 years ago

Same issue here (empty class and style=transform: translateZ(0px) on the sticky div created by react-sticky-el).

Using version 2.0.9

This was due to a layout problem, the container where my content was (including <Sticky />) had a height of 100vh, it was actually the body which was scrolling (not the container).

ggregoire commented 2 years ago

@xididri did you find a solution to make it work while keeping 100vh on the container?

capi1O commented 2 years ago

Basically the solution in my case was to use a simpler layout. I have given you access to the project repo so you can have a look. Not sure it will apply to your case though.

(edit: You need to check issue 263 which was fixed by commit ee2dc5f84025c061b9963e279a1b7b83f5e05f20)