Skip to content

Why does TopNavigation grow as the page loads? #2449

Answered by connorlanigan
pcolmer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Philip, thanks for reaching out.
My guess is that you're server-side rendering the Top Navigation and hydrating it on the client, can you confirm whether that is the case?
The Top Navigation component changes its size and layout depending on the available space. This includes showing & hiding different items on the bar, but also applying different padding sizes to make sure it fits well. This measurement and calculation is currently being performed at runtime in the browser, so that it reacts appropriately when the viewport changes. When the Top Navigation is pre-rendered on the server, the dimensions of the viewport are not available, and you get a default size. As soon as the applica…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pcolmer
Comment options

Answer selected by pcolmer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants