breadadams / scroller-motion

🛹 Elegant motion scrolling for React

Home Page:https://scroller-motion.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Position: Sticky not working with scroller-motion

farhadham opened this issue · comments

Hey Everyone, I just tried the position sticky and it seems that scroller-motion somehow prevents it.
Removing works normal

@farhadham if I'm not mistaken this is due to a CSS spec. position: fixed has no effect inside an element with CSS transform styles (which is present on the scroller-motion wrapper).

You can try one of the following workarounds:

  1. Move the fixed elements outside of the <ScrollerMotion> component: #4 (comment)
  2. Render the fixed element outside of the <ScrollerMotion> with the React Portals API: #4 (comment)