mkoryak/floatThead

Header not aligned due to scroll bars

Messenger opened this issue · 4 comments

I have an issue where the table headers do not take into account the scroll bar size when they reflow. Here is an example that repros the issue in IE10 and chrome:

http://jsfiddle.net/DxX2T/23/

if you scroll all the way to the right you will notice the table is not aligned with the header. I have resolved this by moving the calculateScrollBarSize() to after ensureReflow() and changing calculateScrollBarSize() to do the following:

  function calculateScrollBarSize(){ //this should happen after the floating table has been positioned
    if($scrollContainer.length){
        scrollbarOffset.horizontal = $scrollContainer.width() < $table.width() ? scWidth : 0;
        scrollbarOffset.vertical = $scrollContainer.height() < $table.height() ? scWidth : 0;
        scrollbarOffset.horizontal = $scrollContainer.width() - scrollbarOffset.vertical < $table.width() ? scWidth : 0;
        scrollbarOffset.vertical = $scrollContainer.height() - scrollbarOffset.horizontal < $table.height() ? scWidth : 0;
    }
  }

Thanks, this looks like a windows only bug, ill see what I can do

for now a workaround would be to make the container height 16 pixels bigger :)

fixed on master

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.