Why does TopNavigation grow as the page loads? #2449
-
Untitled.video.mp4I've created a much slowed-down video of this happening. The TopNavigation component is defined as follows:
and is used within an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Philip, thanks for reaching out. If you're currently using server-side rendering in your application, I would recommend to disable server-side rendering for at least this component (or larger parts / all of your application), and rendering it only on the client. Some frameworks already offer options for that (e.g. NextJS with the |
Beta Was this translation helpful? Give feedback.
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…