Skip to content

Commit

Permalink
Merge pull request #2 in INC/primereact-fork from feature/datatable-o…
Browse files Browse the repository at this point in the history
…verride-virtual-scroll-height to master

* commit 'bf7f8cc0e5dc73e5d0454cce3582ff07176325c1':
  virtual scroller height set to max of virtualScrollHeightOverride or totalCollapsedHeight
  virtual scroller height set to max of virtualScrollHeightOverride or totalCollapsedHeight
  virtual scroller height set to max of virtualScrollHeightOverride or totalCollapsedHeight
  virtual scroller height set to max of virtualScrollHeightOverride or totalCollapsedHeight
  • Loading branch information
Eirik Aasved Holst authored and Eirik Aasved Holst committed Aug 30, 2019
2 parents 5a94513 + bf7f8cc commit e4da885
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "primereact-fork",
"version": "3.1.9-fork-1.0.1",
"version": "3.1.9-fork-1.0.2",
"homepage": "/primereact",
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions src/components/datatable/ScrollableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ export class ScrollableView extends Component {

if(!this.props.frozen) {
this.alignScrollBar();

if(this.props.virtualScroll) {

if (this.props.virtualScroll) {
const collapsedHeight = this.props.totalRecords * this.props.virtualRowHeight;
if (this.props.virtualScrollHeightOverride) {
this.virtualScroller.style.height = this.props.virtualScrollHeightOverride + 'px'
}
else {
this.virtualScroller.style.height = this.props.totalRecords * this.props.virtualRowHeight + 'px';
this.virtualScroller.style.height = Math.max(collapsedHeight, this.props.virtualScrollHeightOverride) + 'px';
} else {
this.virtualScroller.style.height = collapsedHeight + 'px';
}
}
}
Expand Down

0 comments on commit e4da885

Please sign in to comment.