3 ms·
> PSA: position: sticky; exists now. I joined this company that has a 10 year old Dojo application as their UI. Before I joined they had a guy come over once a
by Cthulhu_ 5y ago
> PSA: position: sticky; exists now.
I joined this company that has a 10 year old Dojo application as their UI. Before I joined they had a guy come over once a week for some maintenance work. They spent several days trying to solve an issue where a bar with a 'save / close' action would show up at the bottom of a dialog, making users scroll down. This was a complaint that users had for literal years.
I added position: sticky and had to figure out how it worked, but the issue was resolved with about ten minutes of work. Not to pat my own shoulder too much, but that was pretty cool. Plus it works gracefully, in that if the browser doesn't support it yet, it falls back to (or, should) to the old behaviour.
- andai 5y ago>falls back to the old behaviour Showing up at the bottom?
- ironmagma 5y agoJust don’t try using it in combination with display: table-* or you will curse position: sticky’s name forever.
- shrew 5y agoOr as part of display: grid which also has severe quirks with position: sticky despite it being a much newer API.
- chrismorgan 5y agoIs this still so? I know that in the earlier days of `position: sticky` it didn’t play well with tables (with I think the same limitations on non-tables using `display: table` et al.), but my understanding matches https://caniuse.com/css-sticky https://caniuse.com/css-sticky, that Firefox’s limitation in that area has been fixed for four years, and Chromium’s for ten months.
- noduerme 5y agoFirst there was position: sticky. Then it was removed and killed. Now it's back? Guh. It's always had problems. It was very hard to wrangle, especially if you have containers in other containers. I know jQuery isn't cool these days, but if you have a site that uses it, sticky-kit is the way to go. It's very fast and handles a lot of corner cases (pun intended).