Fix scroll flicker

Merged Eric Eastwood requested to merge 34407-flickering-scroll-v1 into master

What does this MR do?

Fix scroll flicker that can occur when you are on a page with a sidebar and your viewport has just a bit of overflow.

Are there points in the code the reviewer needs to double check?

Picks cleanly into EE master

I am only able to reproduce after these were introduced and but they were merged after which was a scroll issue. I want to reproduce at that earlier time to make sure I am not reintroducing the other issue but not having any luck 🤔

How can we better test this?

  • It depends on the viewport size which doesn't seem to be very configurable in Karma
  • We could make a rspec integration test and count the number of affix events

For reference, here is Bootstrap's affix.js that we use.

Things to inspect

  • MR when affix and affix-top
  • Issue when affix and affix-top
  • Issues Bulk Edit when affix and affix-top
  • Wiki page when affix and affix-top

My reproductions:

  1. Checkout CE master, 585e6aa5 HEAD
  2. Visit 1918x717, (MR with test bar for title and description and 1 diff note),
  3. Scroll down to the bottom of the page (you should be on the "Discussion" tab)
  4. Switch to the "Commits" tab the and notice the continuous scroll flicker or switch to the "Changes" tab to see flicker until content loads in
  1. Checkout CE master, 585e6aa5 HEAD
  2. Visit 1901x1009, (Issue with 2 lines of text and 3 comments),
  3. Scroll down to the bottom of the page and notice continuous scroll flicker

Why was this MR needed?

  • The .right-sidebar swaps out .affix/.affix-top back and forth causing fast visual scroll flicker.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #34407 (closed)

cc @annabeldunstone @mikegreiling

Edited by Eric Eastwood

Merge request reports