Skip to content

Commit

Permalink
Fixed #2431 - DataTable virtualScroll index bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Nov 19, 2021
1 parent 10c084e commit c1f42be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/virtualscroller/VirtualScroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ export class VirtualScroller extends Component {
if (_currentIndex <= _numT)
return 0;
else
return _isScrollDownOrRight ?
(_currentIndex < _triggerIndex ? _first : _currentIndex - _numT) :
(_currentIndex > _triggerIndex ? _first : _currentIndex - (2 * _numT));
return Math.max(0, _isScrollDownOrRight ?
(_currentIndex < _triggerIndex ? _first : _currentIndex - _numT) :
(_currentIndex > _triggerIndex ? _first : _currentIndex - (2 * _numT)));
};
const calculateLast = (_currentIndex, _first, _last, _num, _numT, _isCols) => {
let lastValue = _first + _num + (2 * _numT);
Expand Down

0 comments on commit c1f42be

Please sign in to comment.