-
Notifications
You must be signed in to change notification settings - Fork 129
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
Scroll bar is not included in grid mode item position calculation. #241
Comments
Thanks for the report. I was aware of this issue, but it's time to fix it :) Ref: PolymerElements/iron-scroll-target-behavior#17 |
Thanks for the feedback, but PolymerElements/iron-scroll-target-behavior#17 would not 100% solve this. As i wrote in the PR, in the docs about the --iron-list-items-container mixin, there is an example with an margin, but this margin would also have no affect to the item position calculation. Since the elements are placed inside the #items, the position calculations should be based on #items, not on the scrollTarget. |
* Change the _viewportWidth from the scrollTarget width to the items container width. In the doc there is an demo of giving an margin to the items container via the --iron-list-items-container mixin. But if the viewport is measured from the scrollTarget, the _itemsPerRow calculation and the rowOffset calculation don't include the margin. Same goes for the width of an Scrollbar. * Changed method to measure item width... ... from offsetWidth to getBoundingClientRect().width to get exact value instead of an integer.
* Change the _viewportWidth from the scrollTarget width to the items container width. In the doc there is an demo of giving an margin to the items container via the --iron-list-items-container mixin. But if the viewport is measured from the scrollTarget, the _itemsPerRow calculation and the rowOffset calculation don't include the margin. Same goes for the width of an Scrollbar. * Changed method to measure item width... ... from offsetWidth to getBoundingClientRect().width to get exact value instead of an integer.
Description
Scroll bar is not included in grid mode item position calculation.
Expected outcome
e.g. Viewport width is 520px, scrollbar takes 20px, and one item 250px, i expect that 2 items are in one row and the viewport is exactly filled.
Actual outcome
The positions are calculated like there is no scrollbar, leading to an 10px margin on the left side and an horizontal scrollbar.
Live Demo
https://jsbin.com/hokulijenu/5/edit?html,output
Seems like inline dom-module does not work in jsbin.
Steps to reproduce
Browsers Affected
Thus scrollbars are taking no room on mobiles and on safari these are not affected.
I have not tested this on any microsoft browser.
Probably it does not occur on Chrome or FF on OS X.
The text was updated successfully, but these errors were encountered: