Open Bug 1571330 Opened 6 years ago Updated 3 years ago

Fixed element inside sticky container inside element with overflow-y: auto is being partially hidden

Categories

(Core :: Layout: Scrolling and Overflow, defect, P3)

68 Branch
defect

Tracking

()

People

(Reporter: felipe.gdr, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36

Steps to reproduce:

1- create a container and force it to have a vertical scrollbar (overflow-y: auto with big content)
2- create a child element which has position: sticky
3- inside the sticky element, create an element with position: fixed and force it to overflow horizontally

Actual results:

The element with position: fixed is partially hidden. It seems like the top most container (the one with overflow-y: auto) is not overflowing in the x axis.

I have created a Code Sandbox that clearly reproduces the problem. I strongly recommend looking at this example since it's much easier to understand the problem:
https://codesandbox.io/s/firefox-stickyoverflow-weirdness-z27rw

Expected results:

The element with position: fixed is fully displayed -> this is the behaviour in other browsers (tested in Chrome and Safari)

Component: Untriaged → Layout: Scrolling and Overflow
Product: Firefox → Core
Attached file testcase 1

Here's a somewhat reduced standalone testcase.

There are some known issues with flexbox layout and position:sticky (and this testcase does use flexbox). Putting a dependency on one of those in case it's related.

Status: UNCONFIRMED → NEW
Depends on: 1377072
Ever confirmed: true
Priority: -- → P3
Severity: normal normal → S3 S3

While I think Felipe's test case is a great example of the issue I just wanted to add that it's not specific to overflow-y but overflow in general.

Hello, I encountered this issue today. Here is my CodeSandbox. Just compare vs Chrome to see the issue. In my case I am not using any display:flex.
https://codesandbox.io/s/escaping-a-hidden-container-e4dby9?file=/index.html

Someone also reported it in https://bugzilla.mozilla.org/show_bug.cgi?id=1452006 and provided the jsfiddle: https://jsfiddle.net/jjh63tpe/

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: