-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bootstrap 3 fixedheader scrolling down issue #105
Comments
Thanks for posting this and the test case - there is certainly an issue there. We will look into this can get back to you. |
We are having some difficulty in figuring out what is causing them I'm afraid. It probably isn't going to be a quick fix. |
I guess it is related to something like columns.adjust(). I have another case, when I scroll down the page and the fixed header is just going to show, it redraws the table and changes the columns width so all the content can be shown on the page without scrollbar, it jumps to top of the page and scrollbar is disappeared of course. So I guess when the fixed header is going to show, it tries to adjust the columns width to show all the content without scrollbar. I hope this can help you find the cause. |
@AllanJard has the cause been found? Or are additional examples required? |
We haven't figured it out yet I'm afraid. If you have another test case, that certainly won't hurt. |
@AllanJard In dataTables.fixedHeader.js, I add console.log($(document).scrollTop()) to line 332 and 342. I find after line 341 .append( itemElement ); the output is 0 which means it jumps to the top. I hope this can help you to fix it. |
In case it could help you to find the cause of the problem: this happens even without Bootstrap3. I'm using plain datatables, without Bootstrap, and I have the same problem. I changed the version of FixedHeader to v3.1.9 and it worked fine. |
I also found this issue, I have posted to the datatables forums but have also found that downgrading from Bootstrap 5 to 4 resolved the issue. You may need to upgrade from BS3 to 4. Here is my post on the forum with another test case: When using the fixedHeader plugin, if all the rows total height is slightly more than the total height of the browser viewport, it becomes almost impossible to scroll down to the bottom and the scroll bar shoots back to the top when the fixedheader appears. Link to example code: http://live.datatables.net/muvideli/1/edit |
Many thanks for that example - I see the error there as well and with our latest nightly too. I'll report back here when I have more info. |
@AllanJard in case there is a way to help resolving this, for now I locked the use of Fixed Header plugin to |
Have you tried the nightly? It has some changes that should help resolve this. |
I tried https://github.com/DataTables/FixedHeader/releases/tag/3.4.0 last week. That version was released on 04-07-2023 and seems to include all "recent" changes. However, when I try it again now with 3.4.0, it seems not possible to reproduce the problem, so I am not sure what went wrong last week 😉 . I will monitor it! |
Oh sorry - I had forgotten I'd done that release! This is the fix that I was specifically thinking of. |
Update: in some cases this issue still occurs on Chrome 121.0.6167.184 with:
It happens when scrolling down slowly and the fixed header is about to be activated, when scrolling fast is seems to quickly scroll beyond the fixed header and then the issue does not occur. Another workaround is to make the browser window significantly smaller. For example:
|
I've done a bunch of work on FixedHeader recently and was seeing this exact issue. It is resolved now with the latest builds: https://live.datatables.net/sunuhiyu/1/edit . It should be noted that FixedHeader 4 (which has this fix) will be released alongside DataTables 2 (upon which it depends), very soon. |
@AllanJard thanks for the swift reply. Do you think the fix can be backported to the FixedHeader 3 branch? Upgrading to DataTables 2 is quite a big step 😨 |
Technically, yes I'm sure it can be. This is the commit in question, however there have been a lot of other changes to address other issues, and it is quite possible some of them might impact this - I don't know. It isn't currently on my agenda to back port the change I'm afraid, but I'd take a PR if yourself or someone else wants to make the change and it does resolve that issue. |
reproduce:
My project cannot use nowrap or autowidth. Any way to fix this issue?
attached a gif to show the problem.
The text was updated successfully, but these errors were encountered: