Skip to content
This repository was archived by the owner on Jul 25, 2019. It is now read-only.

Commit f1bc96e

Browse files
committed
bugfix: fix scrolling on border cases when table height was the size of the container
1 parent 8d8fa51 commit f1bc96e

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Bugfixes:
55
- mouse wheel didn't scroll the window when cursor was over Handsontable ([#383](https://github.com/warpech/jquery-handsontable/issues/383), [#627](https://github.com/warpech/jquery-handsontable/issues/627))
66
- methods `countVisibleRows` and `countVisibleCols` were broken since version 0.9.0
77
- WalkontableDom.prototype.offset now returns offset relatively to the document also for position: fixed
8+
- fix scrolling on border cases when table height was the size of the container
89

910
Docs:
1011
- new demo page [Options](http://handsontable.com/demo/options.html). Currently features one option but this will improve over time

Diff for: src/3rdparty/walkontable/src/table.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,9 @@ WalkontableTable.prototype.isColumnInViewport = function (c) {
530530
};
531531

532532
WalkontableTable.prototype.isLastRowFullyVisible = function () {
533-
return (this.getLastVisibleRow() === this.instance.getSetting('totalRows') - 1 && this.rowStrategy.remainingSize <= 0);
533+
return (this.getLastVisibleRow() === this.instance.getSetting('totalRows') - 1 && !this.rowStrategy.isLastIncomplete());
534534
};
535535

536536
WalkontableTable.prototype.isLastColumnFullyVisible = function () {
537-
return (this.getLastVisibleColumn() === this.instance.getSetting('totalColumns') - 1 && this.columnStrategy.remainingSize <= 0);
537+
return (this.getLastVisibleColumn() === this.instance.getSetting('totalColumns') - 1 && !this.columnStrategy.isLastIncomplete());
538538
};

Diff for: src/3rdparty/walkontable/src/viewport.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ WalkontableViewport.prototype.getWorkspaceHeight = function (proposedHeight) {
3434
}
3535

3636
if (height !== Infinity) {
37-
if (proposedHeight > height) {
37+
if (proposedHeight >= height) {
3838
height -= this.instance.getSetting('scrollbarHeight');
3939
}
4040
else if (this.instance.wtScrollbars.horizontal.visible) {
@@ -58,7 +58,7 @@ WalkontableViewport.prototype.getWorkspaceWidth = function (proposedWidth) {
5858
}
5959

6060
if (width !== Infinity) {
61-
if (proposedWidth > width) {
61+
if (proposedWidth >= width) {
6262
width -= this.instance.getSetting('scrollbarWidth');
6363
}
6464
else if (this.instance.wtScrollbars.vertical.visible) {

Diff for: src/3rdparty/walkontable/test/jasmine/spec/table.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ describe('WalkontableTable', function () {
783783
});
784784

785785
describe('isLastRowFullyVisible', function () {
786-
/*it('should be false because it is only partially visible', function () {
786+
it('should be false because it is only partially visible', function () {
787787
createDataArray(8, 4);
788788

789789
var wt = new Walkontable({
@@ -800,7 +800,7 @@ describe('WalkontableTable', function () {
800800
wt.draw();
801801

802802
expect(wt.wtTable.isLastRowFullyVisible()).toEqual(false);
803-
});*/
803+
});
804804

805805
it('should be true because it is fully visible', function () {
806806
createDataArray(8, 4);

0 commit comments

Comments
 (0)