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

Instant Click loading bar width calculations are based off page width plus width of scrollbar #161

Open
wpgbrown opened this issue Dec 18, 2017 · 1 comment

Comments

@wpgbrown
Copy link

I am using the minified version of instant click version 3.1.0 (current)

I have a page that uses a fixed navbar and content that is not fixed, but when the instant click loading bar is created, it uses innerWidth instead of clientHeight. This causes on my page the width of the element to be more than the current page width, as it includes the width of the scrollbar. This seems to work in normal cases, but in my case this causes the page to have problems with horizontal scrollbars (and coupled with the moving of the scrollbar, moves the instant click loading bar to the left, it causes more problems).

My suggestion would be to either use clientWidth if the doctype is set (as it is inaccurate if it is not set) and then use innerWidth when it is not or to have a configuration option when initialised to use clientWidth instead of innerWidth.

Thanks,
Wpgbrown

@wpgbrown
Copy link
Author

I have done some tests and have concluded that using document.documentElement.clientWidth is better than innerWidth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant