DataTables / DataTables/FixedHeader

Columns jump after scrolling back up with fixedHeader and no autoWidth

Open
#94 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
73
Forks
83
Avg merge
4m
Merged PRs (30d)
1

Description

Steps to reproduce:

  1. Load this fiddle. https://jsfiddle.net/frabcus/eyk79woh/13/
  2. Make the window narrow vertically.
  3. Scroll down the page - the header stays fixed (floating)
  4. Scroll back up.
  5. At the top, when the header merges back in, all the column widths jump to new values.

I've narrowed it down to this code in _unsize: https://github.com/DataTables/FixedHeader/blob/master/js/dataTables.fixedHeader.js#L348

The cells are the only place the width of columns is stored in the DOM. And _unsize wipes those width values, resetting the table to not have fixed widths. If I make _unsize just do nothing and return, everything works fine.

The fix for bug #57 introduced this code. I don't know the solution as I don't fully understand the other cases. I'm not sure why for any header case the widths should be wiped.

DataTables-1.10.13
FixedHeader-3.1.2
jquery-3.1.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked fiddle and the _unsize function in js/dataTables.fixedHeader.js, using the reported DataTables 1.10.13 and FixedHeader 3.1.2 setup. Reproduce the scroll sequence, then inspect how header width values are removed. Done means scrolling back to the top no longer changes the column widths while the other header cases remain working.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.