Unverified Commit 08b19161 authored by Már Örlygsson's avatar Már Örlygsson Committed by GitHub

fix: Shift route-announcer to top of layout parent (#44853)

Without `top: 0` the route announcer triggers subtle layout shift in
Blink/Chrome.

BTW, this mostly (possibly only?) occurs on pages with specific overflow
proprty combinations on `<html/>` and `<body/>`, and only when rendering
inside a custom element like the `<next-route-announcer />` portal.
(Changing the portal into `<div/>` seems to make the layout shift
disappear, but that would be far more invasive change than just adding
`top:0`.)

---------
Co-authored-by: 's avatarShu Ding <g@shud.in>
parent fb78e61b
......@@ -9,6 +9,7 @@ const nextjsRouteAnnouncerStyles: React.CSSProperties = {
overflow: 'hidden',
padding: 0,
position: 'absolute',
top: 0,
width: '1px',
// https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment