Skip to content

Commit

Permalink
bugfix: scrolls to top of table on any key press if the top is not on…
Browse files Browse the repository at this point in the history
… the screen (issue #348)
  • Loading branch information
warpech committed Feb 20, 2013
1 parent 8d00ed8 commit 408f29d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## HEAD

Bugfix:
- scrolls to top of table on any key press if the top is not on the screen ([#348](https://github.com/warpech/jquery-handsontable/issues/348))

## [0.8.5](https://github.com/warpech/jquery-handsontable/tree/v0.8.5) (Feb 18, 2013)

Bugfix:
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.handsontable.full.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Mon Feb 18 2013 19:46:29 GMT+0100 (Central European Standard Time)
* Date: Wed Feb 20 2013 11:18:51 GMT+0100 (Central European Standard Time)
*/

.handsontable {
Expand Down
13 changes: 7 additions & 6 deletions dist/jquery.handsontable.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Mon Feb 18 2013 19:46:29 GMT+0100 (Central European Standard Time)
* Date: Wed Feb 20 2013 11:18:51 GMT+0100 (Central European Standard Time)
*/
/*jslint white: true, browser: true, plusplus: true, indent: 4, maxerr: 50 */

Expand Down Expand Up @@ -2674,8 +2674,9 @@ var texteditor = {
}

if (instance.getSettings().asyncRendering) {
texteditor.refreshDimensions(instance, row, col, keyboardProxy); //need it instantly, to prevent https://github.com/warpech/jquery-handsontable/issues/348
setTimeout(function () {
texteditor.refreshDimensions(instance, row, col, keyboardProxy);
texteditor.refreshDimensions(instance, row, col, keyboardProxy); //need it after rerender to reposition in case scroll was moved
}, 0);
}
else {
Expand Down Expand Up @@ -2827,10 +2828,10 @@ Handsontable.TextEditor = function (instance, td, row, col, prop, keyboardProxy,
});

/*keyboardProxy.on('blur.editor', function () {
if (texteditor.isCellEdited) {
texteditor.finishEditing(instance, null, row, col, prop, keyboardProxy, false);
}
});*/
if (texteditor.isCellEdited) {
texteditor.finishEditing(instance, null, row, col, prop, keyboardProxy, false);
}
});*/

keyboardProxy.on('refreshBorder.editor', function () {
setTimeout(function () {
Expand Down
2 changes: 1 addition & 1 deletion jquery.handsontable.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Mon Feb 18 2013 19:46:29 GMT+0100 (Central European Standard Time)
* Date: Wed Feb 20 2013 11:18:51 GMT+0100 (Central European Standard Time)
*/

.handsontable {
Expand Down
13 changes: 7 additions & 6 deletions jquery.handsontable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Mon Feb 18 2013 19:46:29 GMT+0100 (Central European Standard Time)
* Date: Wed Feb 20 2013 11:18:51 GMT+0100 (Central European Standard Time)
*/
/*jslint white: true, browser: true, plusplus: true, indent: 4, maxerr: 50 */

Expand Down Expand Up @@ -2674,8 +2674,9 @@ var texteditor = {
}

if (instance.getSettings().asyncRendering) {
texteditor.refreshDimensions(instance, row, col, keyboardProxy); //need it instantly, to prevent https://github.com/warpech/jquery-handsontable/issues/348
setTimeout(function () {
texteditor.refreshDimensions(instance, row, col, keyboardProxy);
texteditor.refreshDimensions(instance, row, col, keyboardProxy); //need it after rerender to reposition in case scroll was moved
}, 0);
}
else {
Expand Down Expand Up @@ -2827,10 +2828,10 @@ Handsontable.TextEditor = function (instance, td, row, col, prop, keyboardProxy,
});

/*keyboardProxy.on('blur.editor', function () {
if (texteditor.isCellEdited) {
texteditor.finishEditing(instance, null, row, col, prop, keyboardProxy, false);
}
});*/
if (texteditor.isCellEdited) {
texteditor.finishEditing(instance, null, row, col, prop, keyboardProxy, false);
}
});*/

keyboardProxy.on('refreshBorder.editor', function () {
setTimeout(function () {
Expand Down
11 changes: 6 additions & 5 deletions src/editors/textEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ var texteditor = {
}

if (instance.getSettings().asyncRendering) {
texteditor.refreshDimensions(instance, row, col, keyboardProxy); //need it instantly, to prevent https://github.com/warpech/jquery-handsontable/issues/348
setTimeout(function () {
texteditor.refreshDimensions(instance, row, col, keyboardProxy);
texteditor.refreshDimensions(instance, row, col, keyboardProxy); //need it after rerender to reposition in case scroll was moved
}, 0);
}
else {
Expand Down Expand Up @@ -235,10 +236,10 @@ Handsontable.TextEditor = function (instance, td, row, col, prop, keyboardProxy,
});

/*keyboardProxy.on('blur.editor', function () {
if (texteditor.isCellEdited) {
texteditor.finishEditing(instance, null, row, col, prop, keyboardProxy, false);
}
});*/
if (texteditor.isCellEdited) {
texteditor.finishEditing(instance, null, row, col, prop, keyboardProxy, false);
}
});*/

keyboardProxy.on('refreshBorder.editor', function () {
setTimeout(function () {
Expand Down

0 comments on commit 408f29d

Please sign in to comment.