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

ngGrid- version 2.x - Horizontal scrollbar appears even if column widths fit the viewport. #3044

Closed
HuongCu opened this issue Mar 18, 2015 · 1 comment
Milestone

Comments

@HuongCu
Copy link

HuongCu commented Mar 18, 2015

When grid has vertical bar displayed, horizontal scroll is always visible even column widths fit the viewport. This plunker shows the example of issue:
http://plnkr.co/edit/ZllYpsC815Rp0UrdznlA?p=preview

Look at the code:
var rightPad = 0;
if ((i === cols.length - 1) && (sumWidth + col.width < grid.elementDims.rootMaxW)) {
rightPad = grid.elementDims.rootMaxW - sumWidth - col.width;
}
css += "." + gridId + " .col" + i + " { width: " + (col.width + rightPad) + "px; left: " + sumWidth + "px; height: " + rowHeight + "px }" +
"." + gridId + " .colt" + i + " { width: " + (col.width + rightPad) + "px; }";

rightPad doesn't take scrollH into account. Therefore the column with is a little bit over viewport.

Seems a similar scrollbar issue was reported in version 3.0 and fixed.

@PaulL1 PaulL1 added the 2.x label Mar 18, 2015
@PaulL1 PaulL1 added this to the 2.x.next milestone Mar 26, 2015
jjkovacs added a commit to jjkovacs/ng-grid that referenced this issue Apr 14, 2015
The fix for this issue seems to have introduced various other issues.
I've noticed that the column headers sometimes get out of alignment with
their corresponding columns, especially when a grid contains pinned
columns. This should also fix angular-ui#3044.
alleyj added a commit to FernCreek/ng-grid that referenced this issue Jun 19, 2015
This fix caused cells to not account for the existence of a vertical
scrollbar which would cause a horizontal scrollbar to also appear. This
should fix angular-ui#3044.

Took from jjkovacs/ng-grid@2d2dcaa
alleyj added a commit to FernCreek/ng-grid that referenced this issue Jun 19, 2015
This fix caused cells to not account for the existence of a vertical
scrollbar which would cause a horizontal scrollbar to also appear. This
should fix angular-ui#3044.

Took from jjkovacs/ng-grid@2d2dcaa
@AgDude
Copy link
Contributor

AgDude commented Nov 13, 2015

This issue was moved to angular-ui/ng-grid-legacy#1

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

3 participants