Open Bug 1640863 Opened 6 years ago Updated 6 years ago

Scroll anchoring is not working when table has sticky header

Categories

(Core :: Layout: Scrolling and Overflow, defect, P3)

76 Branch
defect

Tracking

()

People

(Reporter: tomashtaylor, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36

Steps to reproduce:

I created a minimalist codepen to imitate the webapp on which I noticed the bug. It displays data in a table with sticky header that lazy loads new elements if we scroll to the bottom (and removes elements from the front).

It works fine for 1 or 2 paging, then the scroll anchoring doesn't work.

  1. Open this pen: https://codepen.io/szt3/pen/rNOodeM
  2. Scroll to the bottom
  3. Click "page"
  4. Repeat steps 2 and 3 until the 14th item is visible
  5. Click "page"

Actual results:

  1. Items are loaded, but the the container scrolls to the bottom

Expected results:

  1. items are loaded and the scroll position stays as is.

Notice: It works then the table header isn't sticky

Component: Untriaged → Layout: Scrolling and Overflow
Product: Firefox → Core

Hmm, does it reproduce for you on Nightly? Your codepen seems to be working for me, so I wonder what's the difference in our setup.

Flags: needinfo?(tomashtaylor)

I just installed the latest Nightly (78.0a1 (2020-05-26) (64-bit)), and it is reproducible. Btw I use win 10.
video: https://streamable.com/y64wu6

Flags: needinfo?(tomashtaylor)

Cool, thanks for the recording, I see... FWIW, I think relying on scroll anchoring is generally bad practice (if only, it's not supported in WebKit browsers). It's intended as a UX improvement, but if you can restore the scroll position properly yourself it's always better.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Thanks for confirming the bug.
Btw it is working on the latest Chrome and Edge.

Sure, well, they're effectively the same engine so it's not surprising :)

You need to log in before you can comment on or make changes to this bug.