Skip to content

Columns jump after scrolling back up with fixedHeader and no autoWidth #94

@frabcus

Description

@frabcus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions