Polyfill for CSS `position: sticky`
Stickyfill.forceSticky()
to force-enable the polyfill in the browsers that support position: sticky
natively.Thanks to @liuhelen10 for the contribution!
Fixed Chrome scrolling bug.
Turns out expecting to get window
form this
in any environment wasn’t the best idea. Some bundlers/module fetching tools don’t expect you would do such stupid thing.
Fixed now, thanks to @soluml!
Improved support for stickies with a direct shadowRoot parent 🕶
ES6 source, module definition, all that good stuff.
New API ¯\_(ツ)_/¯
Nope. No reason to update. Keep the old version, it’s fine.
Took me 3 years. Because reasons.
npm install stickyfilljs --save
or yarn add stickyfilljs
.
Stickies with display: none
are now ignored until the next rebuild
(including window resize). This fixes layout problems with sticky elements hidden by media queries in particular (and maybe some other scenarios I didn't think of).
Spec says table cells are not eligible for position: sticky
. Safari supports table cell sticky positioning, but Firefox followed the spec and rolled out the support for sticky positioning recently. We now have a nasty situation where we just can't properly polyfill table cell sticky positioning without sniffing due to difference in realisations.
I decided to remove the support for table cell stickies to make the polyfill more consistent across the board. Sorry, lads, no sticky table headers for you.
Floated stickies are now properly supported (props to @dzucconi)