ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Horizontal scroll on pinned column causes grid to scroll to rightmost border

Open joelmertanen opened this issue 8 years ago • 10 comments

Steps to reproduce:

  1. Open http://ui-grid.info/docs/#/tutorial/203_pinning
  2. Place mouse on the pinned Name column
  3. 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. ui-grid

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.

joelmertanen avatar Jul 23 '15 12:07 joelmertanen

+1

stanleegoodspeed avatar Mar 28 '16 14:03 stanleegoodspeed

+1

SeedSultan avatar May 22 '16 22:05 SeedSultan

+1

mmgmoh avatar Jan 24 '17 18:01 mmgmoh

+1 (seeing this in Safari)

nw-fid avatar Jan 24 '17 18:01 nw-fid

Anyone found a workaround?

mccxiv avatar Feb 01 '17 05:02 mccxiv

+1

jlbaez avatar Mar 15 '17 20:03 jlbaez

No workarounds found, this issue is forcin us to switch away from ui grid

SeedSultan avatar Mar 15 '17 20:03 SeedSultan

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>"
)

yarl avatar Apr 07 '17 13:04 yarl

+1

ssudhanshudas avatar Feb 05 '18 09:02 ssudhanshudas

@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?

harishpuvvada avatar Jul 30 '19 23:07 harishpuvvada