[csswg-drafts] [css-position] sticky should be attached to parent with overflow-x or overflow-y depending on top/bottom and left-right (#9140)

yelhouti has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-position] sticky should be attached to parent with overflow-x or overflow-y depending on top/bottom and left-right ==
The current [Spec](https://www.w3.org/TR/css-position-3/#valdef-position-sticky) says:
> "its offsets are automatically adjusted in reference to the nearest ancestor [scroll container’s](https://www.w3.org/TR/css-overflow-3/#scroll-container) [scrollport](https://www.w3.org/TR/css-overflow-3/#scrollport) "..." in whichever axes the inset properties are not both [auto](https://www.w3.org/TR/css-position-3/#valdef-top-auto)". 

This doesn't work great when you have a table where you want your header to stick to the top of the document, but a column, to sticky only to the table.
You would want the table or table's container to have an `overflow-x: auto` to enable horizontal scrolling, and have the column stick to that with `left: 0` or `right: 0`. But you would want the table header to stick to the top of the page or the the main container of the page  (ie: parent with `overflow-y: auto`) and not the table or it will never be visible.

Related issues comments:
https://github.com/w3c/csswg-drafts/issues/865
https://github.com/w3c/csswg-drafts/issues/865#issuecomment-1365490283




Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9140 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 2 August 2023 09:23:46 UTC