v4-beta3 sticky-top not working on safari
See original GitHub issueHello,
I am just developing website with v4-beta3 and sticky-top is not working. The @supports rule doesnt get applied. I found older post with this code:
@supports ((position: -webkit-sticky) or (position: sticky)) {
.sticky-top {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
}
}
When I replace the new code with the old it is working.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
sticky-top does not work with Angular8/safari - Stack Overflow
It works fine on Chrome/Firefox, but not on Safari on Mac or iPhone. I understand that it doesn't work with Angular components, but...
Read more >Why doesn't "position: sticky" work in Safari?
There's a CSS property called position: sticky that makes things stick to the top of the browser window (like a navbar) while scrolling....
Read more >How to Fix Issues With CSS Position Sticky Not Working?
Learn possible reasons why CSS position sticky might not be working for you.
Read more >CSS 'position: sticky' not working? Try 'overflow
How to make position: sticky work with an ancestor's or parent's overflow: ... Sadly, this CSS property is also not supported by Safari....
Read more >How to make position sticky work in Safari | In The Digital
<section style="display: relative"> <div style="position: sticky; top: 150px; background: pink;"> I'm sticky </div> <div ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve encountered this problem occurs on:
… that isn’t an exhaustive list, but it covers the lion’s share of mobile browsing.
For the fix, @Webotvorba has the right idea: we need to add a
position: -webkit-sticky
rule above the non-prefixedposition: sticky
one. I’m a fan of wrapping the things in a@supports
clause in keeping with the way we currently have written the scss for.sticky-top
.Here’s a codepen: https://codepen.io/aldeng/pen/WzMGdK
Note: the codepen example doesn’t use
@supports
, because codepen’s env evidently doesn’t correctly expose the client browser’s support forposition
rules. But I’ve successfully tested the@supports
mod locally, outside the codepen env.The result looks like:
… plus, we have to modify the general case where the user can apply
.position-sticky
to any positioned element.PR for this mod is https://github.com/twbs/bootstrap/pull/25964
Closing as this isn’t an issue with our code but user integration.