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

Mac OS X scroll bar causes incorrect cell offsets #466

Closed
mauricesnip opened this issue Sep 29, 2016 · 3 comments
Closed

Mac OS X scroll bar causes incorrect cell offsets #466

mauricesnip opened this issue Sep 29, 2016 · 3 comments

Comments

@mauricesnip
Copy link

mauricesnip commented Sep 29, 2016

First of all, thanks for developing such a fantastic carousel experience. I can't think of a better one!

Though, I've discovered a bug that affects Mac users with a "Show scroll bars" setting other than "When scrolling". Default for this setting is "Automatically based on mouse or trackpad". It took quite a while to figure it all out.

screen shot 2016-09-29 at 13 15 30

This bug relates to issues #139 and #147, in a way that cell offsets are miscalculated. For example, the second cell gets a left of 100.59% instead of 100%.

This bug happened to me when (hold on to your butts) I connected a mouse other than the Magic Mouse. In my case a Logitech MX518. Mac OS detects this mouse as a touch incapable mouse and decides to show scroll bars for every viewport that needs scrolling. This happens with the option set to its default "Automatically based on mouse or trackpad". The issue remains even after the carousel is repainted to fit vertically (from stacked cells without JS, to a carousel when initialized).

So, as I see it; every Mac user without a Magic Mouse or trackpad (with a third party mouse plugged in) or with "Show scroll bars" set to "Always" has this issue.

Test case: http://codepen.io/mauricesnip/pen/gwxajv

Addendum

Chrome, Firefox and Safari all share this issue.

@desandro
Copy link
Member

desandro commented Oct 1, 2016

Another way you can fix this is with CSS

html { overflow-y: scroll; }

This bug only occurs if your page content without Flickity enabled does not trigger a scrollbar.

I may need to add this gotcha to the docs.

@desandro desandro closed this as completed Feb 9, 2018
@jamesstcrice
Copy link

It seems like this is still an open "bug"?

I purchased a license a long time ago, but guess I had never tried flickity on a a page that was too short to trigger scroll, which seemed to be what caused me to notice this.

I added the overflow-y: scroll; - but that causes a disable scrollbar to show even when there is nowhere to scroll which isn't ideal.

Are you aware of any other work-around?

Thanks

@desandro
Copy link
Member

I added the overflow-y: scroll; - but that causes a disable scrollbar to show even when there is nowhere to scroll which isn't ideal.

That's the necessary and simplest workaround for this issue.

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

No branches or pull requests

3 participants