Fix merge request sticky header flicker

What does this MR do and why?

This MR fixes sticky header flicker on the merge request page.

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Open any merge request
  2. Scroll the page to the exact moment when the sticky header switches to a compact form
  3. Observe no flicker

Merge request reports

Loading
Loading