I am trying to implement the following design. Each item visually looks like it is a single row and should scroll as such, but implementation rules are giving me trouble here. The rules are:
- The entire list should be scrollable on Y-axis if needed (
overflow-y: auto
), denoted by the far right scrollbar. - The right half portion (with the radio boxes) should be scrollable on the X-axis, denoted by the bottom scrollbar
- The bottom scrollbar should always be visible if needed (
overflow-x: auto
)
Taking these rules into consideration, I have decided to make two panels. One left for the texts, and one right for the x-scrolling radios. I mostly have it working in a wireframe, however, the bottom scrollbar is always at the bottom of the radio, not always visible. I know I can't make the scrollbar sticky so I'm a bit stuck how to implement this.
Here's my codepen (it's rough but its only a POC)
I'm also wondering if this approach is the best to take. Ideally I build the row as a true row, without split panels, but I still get stuck on the right side single x-axis scrollbar. An ideal solution would be without JS but not necessarily a blocker.
A few other approaches I've tried are
- Make the left panel sticky, however the Y-axis scrolling rule is not met.
- Set the right panel height to be that of the containers, but then it is not scrolled with the left.
- Make both panels scrollable and use JS to scroll both, but this seems heavy with edge cases (scrolling the incorrect side)
I've been banging my head on this one a fair bit and it's time I ask for help. If anyone could point me in the right direction or correct my approach it would be greatly appreciated!