Skip to content
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

Reflow When Table is Horizontally Scrolled #300

Closed
kev22257 opened this issue Apr 12, 2016 · 12 comments
Closed

Reflow When Table is Horizontally Scrolled #300

kev22257 opened this issue Apr 12, 2016 · 12 comments

Comments

@kev22257
Copy link

Windows 7 (Version 6.1.7601)

Firefox 45.0.1
IE 11
Chrome 49.0.2623.110 m

jQuery.floatThead 1.4.0
jQuery v2.1.4

When a table is inside a div that has horizontal scroll and the user has scrolled some amount to the right a reflow on the table will cause the headers to be misaligned with the table contents. Scrolling any amount in any direction will correct the issue.

I found that the scrollLeft value of the div around the headers is set back to 0 instead of being set to the same scrollLeft value of the div around the table. Adding this code resolves the issue, but I think this is actually a bug? This only affects headers that are positioned absolute.

this.$el.on("reflowed", function(event, $floatContainer) {
    $floatContainer.scrollLeft($floatContainer.siblings("div").scrollLeft());
});
@mkoryak
Copy link
Owner

mkoryak commented Apr 13, 2016

thanks for the report, it sounds like a bug. Im a bit busy this week, I will take a look next week.

@mkoryak
Copy link
Owner

mkoryak commented Apr 18, 2016

hey, if you can make a jsfiddle, I will be able to fix this faster :)

@kev22257
Copy link
Author

@kev22257
Copy link
Author

Make sure you scroll to the right on the table before clicking the button.

@mkoryak
Copy link
Owner

mkoryak commented Apr 18, 2016

thanks, this helps a lot. Right now I am kind of slammed at work, but this will be fixed as soon as I have some down time.

this actually seems like a regression to me. I will check if an older version had this issue.

@m3Lith
Copy link

m3Lith commented May 4, 2016

Any news on this?

@mkoryak
Copy link
Owner

mkoryak commented May 4, 2016

sorry, nothing. I have been busy with life/work. Want to submit a PR?

I think the way to solve this would be to get the scrollLeft of scrollContainer before reflow and set it back to that number after reflow.

@rshah88
Copy link
Contributor

rshah88 commented May 11, 2016

I have a potential fix for this bug based on last comment from @mkoryak , only thing different was that scrollLeft had to be set back on floatContainer and not scrollContainer.
I tried 'git push origin' ..but got permission error. How do I push this to origin ? (Sorry, I am
new with git).

@mkoryak
Copy link
Owner

mkoryak commented May 11, 2016

you need to fork the repo (see where it says "fork" in the top right)
make your changes in the fork. push to the fork and then create a pull request into my repo. you might need to read some docs 🐱

@rshah88
Copy link
Contributor

rshah88 commented May 11, 2016

Done...confirm when you can @mkoryak .Thanks.

@mkoryak
Copy link
Owner

mkoryak commented May 13, 2016

@rshah88 thank you! our PR looks good. I merged it and bumped version to 1.4.1

@lock
Copy link

lock bot commented Dec 10, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants