Skip to content

bug when grid in scrollable container  #14

@valuta777

Description

@valuta777
  [x] bug
  [ ] feature request
  [ ] enhancement

Expected behavior

usual behavior in a scrollable container

Actual behavior

In scrollable container when scrollTop is bigger than 0, dragging ghost jump up for scrollTop value.

Posible fix

in ngx-widget-grid.js in NgxWidgetMoverDirective.prototype.onMove method

 var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft, scrollTop = window.pageYOffset || document.documentElement.scrollTop;
desiredPosition.top = Math.min(Math.max(dragPositionY - this.moverOffset.top + scrollTop, 0), gridDimensions.height - startRender.height+ scrollTop - 1);
desiredPosition.left = Math.min(Math.max(dragPositionX - this.moverOffset.left + scrollLeft, 0), gridDimensions.width - startRender.width + scrollLeft - 1);

Video of behavior

https://drive.google.com/file/d/1036t40UCISyRpJ1PMvXy9_1iyxlbNcF1/view?usp=sharing

Environment details

  • Angular version: 5.2.x

  • OS and version:

  • Browser: [Chrome]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions