Hi there,
I have a simple layout in essence. It’s a ‘table’ that overflows off the horizontal edge of the viewport. The problem occurs when I try to main a section ‘sticky’. This won’t work when a horizontal scroll is introduced.
You can see the basically layout and sticky scroll on this prototype.
This is how the page should ‘work’. But when you scroll horizontally I want both the sticky element + table content to scroll at the same time. When I add the scroll to the parent that contains both the sticky section and table data, this happens. The scroll ‘works’ but the ‘sticky’ element is lost.
Is there a way around this? Here you can see my Figma file (view only). I’m at a lose at how tor resolve this - maybe it’s not possible?
As an aside, I want the table headings (in grey) to remain in view always. I couldn’t find a way for them to be ‘absolute’ and not scroll out the viewport. So I had to duplicate the text and put it over the top of the scrollable section so it didn’t move. You can see that here - is that the only way or can the text be ‘absolute’ but not scroll out of the viewport. Shame sticky horizontal isn’t available yet!
To summarise:
- The ‘products’ at the top should be sticky when they hit the top of the page. With the table content going behind it.
- On horizontal scroll, all the content should move in unison, left/right.
- The table headings (with the light grey background), should always remain in view when scrolling left/right and not move off the edge of the page.
I hope that makes sense. All the prototype links in the copy above can be accessed in the sidebar of the link below. And here’s also the file so you can inspect.
Thanks in advance! 🙏