position: fixed element with 100% width sized to scroll container rather than viewport width
Reported by
alex4j...@gmail.com,
Mar 19 2018
|
|||||||
Issue description(smcgruer@ edit: New readers, please see comment #8 and below for the root cause; it is not animation related.) UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36 Steps to reproduce the problem: 1. Open up https://dev-54ta5gq-brnfxpdrafhks.de-1.platformsh.site/ (dev branch of a work in progress webpage 2. Change device (device toolbar) to e.g. Nexus 5X 3. Reload page What is the expected behavior? Usually the drawer-toggle (.drawer-toggle) should be fixed on the upper right of the page. What went wrong? The button (.drawer-toggle) is animated in the same manner as .heading-primary--sub wich has a `animation: moveInRight 6s;` on it. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 64.0.3282.186 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: This bug apparently also affects Chrome on Android. Chrome on iOS doesn't seem to be affected.
,
Mar 20 2018
Hi sunxd@ You can find all custom styles (SCSS) in this gist. https://gist.github.com/jankal/ebda1b527dc869895b81af58572224e7 It's important to say we also used the Bootstrap Framework v4 in this project.
,
Mar 20 2018
sunxd@ your're right. The button remains out of sight and becomes visible when the animation finished. The problem remains: The button is hidden on first sight.
,
Mar 20 2018
While trying to debug, I noticed that making drawer-toggle's parent position: relative solves the problem. Also, as you have already said above, when the problem occurs, the drawer-toggle is out of sight until the animations end; and it is constantly 84px right of its actual position until the end of animations.
,
Mar 20 2018
Our leading interface developer told me today about some tests he conducted: Apparently this issue only affects the span.heading-primary--sub. When applying the same @keyframes animation to the span.heading-primary--main, this behaviour doesn't occur. I haven't verified this yet.
,
Mar 20 2018
(Bad typo in previous comment completely changes the meaning! Correcting.) What is happening here is that the translateX widens the scroll container. We then widen .top-header to fit this width (see attached image), which causes the menu icon to go off the screen. As the translateX reduces to 0 the scroll container shrinks to the original size, returning the menu to the screen. The reason for the sudden pop-in is issue 713913; it's not really relevant here. I'm not sure what the correct layout behavior is here, given that Firefox doesn't widen .top-header. Let me construct a smaller test-case and run it through the various browsers.
,
Mar 20 2018
Ah, a very interesting discovery. I am able to reproduce this behavior when using devtools in responsive mode, but not when compositing things and just having a small window. I am also able to reproduce on Android. Importantly, I have a minimal repro that requires only style and layout so this is a layout bug, not animations. The fixed-position header is being sized to the width of the scroll container rather than to the width of the viewport. See attached test-case. On Android or under device emulation in devtools the body width and fixed position element width differ.
,
Mar 20 2018
,
Mar 20 2018
,
Mar 20 2018
,
Mar 21 2018
,
Mar 22 2018
,
Mar 22 2018
Considering that there is a test case available now, we worked around the bug on that URL I posted in comment #1. So it's not shown on there anymore. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by sunxd@chromium.org
, Mar 19 2018Labels: Needs-Feedback OS-Android
Status: Available (was: Unconfirmed)