ui-grid
ui-grid copied to clipboard
Horizontal scroll on pinned column causes grid to scroll to rightmost border
Steps to reproduce:
- Open http://ui-grid.info/docs/#/tutorial/203_pinning
- Place mouse on the pinned Name column
- Scroll right either on trackpad or mouse (press shift for horizontal scrolling :) => the body of grid view jumps to the rightmost border. I expect the body of the grid view to not scroll horizontally.
In this gif, I first scroll to right only a bit. The body scrolls to the rightmost border. After that, I scroll down and right with the trackpad. The body scrolls again.
I was able to repeat the results with Chrome 43, Safari and Firefox on OS X 10.10.4 with external mouse and the trackpad. Also, I got similar results with the latest Ubuntu inside a VirtualBox.
+1
+1
+1
+1 (seeing this in Safari)
Anyone found a workaround?
+1
No workarounds found, this issue is forcin us to switch away from ui grid
I've found trick that worked for me. I changed margin-left
to padding-left
in the template below. You can just add this in your controller:
$templateCache.put('ui-grid/uiGridRenderContainer',
"<div role=\"grid\" ui-grid-one-bind-id-grid=\"'grid-container'\" class=\"ui-grid-render-container\" ng-style=\"{ 'padding-left': colContainer.getMargin('left') + 'px', 'margin-right': colContainer.getMargin('right') + 'px' }\"><!-- All of these dom elements are replaced in place --><div ui-grid-header></div><div ui-grid-viewport></div><div ng-if=\"colContainer.needsHScrollbarPlaceholder()\" class=\"ui-grid-scrollbar-placeholder\" ng-style=\"{height:colContainer.grid.scrollbarHeight + 'px'}\"></div><ui-grid-footer ng-if=\"grid.options.showColumnFooter\"></ui-grid-footer></div>"
)
+1
@yarl I have a grid in which i have a left pinned column with links in each row. Your Solution fixes the scrolling problem. But, the padding-left makes the links in the pinned column un-clickable. Is this expected? Can you suggest any work around for my problem?