[UI] Maintain page height on merge request Discussion Changes tab switch on first load.
Created by: cirosantilli
- Open
/namespace/project/merge_requests/1
- Move "Discussion" to the middle of the screen height
- Click "Changes"
Expected outcome: either of:
- "Discussion" and "Changes" are at the same height as before
- they are at the top of the page (if there is enough content to show)
Actual outcome: "Discussion" is at the bottom of the page: we got moved to the top.
Why it happens: on the first change to "Changes", it gets Ajax loaded, "Discussion" tab contents get replaced by the loader image which is very small, and that forces the page to go up because there is not enough content to show.
The bug is made worse by the fact that this only happens on the first tab load: when the tab is loaded the small loader does not appear, and heights don't change anymore, so it feels inconsistent.
If we chose expected solution 2., it suffices to add one ID to the div that holds all the tabs and link to it.