Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Sticky element disappears when triggering modal

  • I’ve used the code below to prevent body scroll when the modals are open. But this makes the sticky bottom element I have on the page (the one with the price and the red button) not to be sticky anymore. It simply goes to the bottom. Any idea how to fix this? Thanks.

    :root:has(.bod-block-popup-wrap.active) {
        overflow:hidden;
      }
  • Hi there,

    The sticky element won’t work if any of its ancestor element is set to overflow:hidden.

    Try using a more specific CSS selector instead of :root.

    Or you can change the sticky element from position: sticky to position:fixed.

  • Fixed instead of sticky seems to do the trick. Thanks so much, Ying.

  • You are welcome   🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.