Skip to content

Commit b0458c5

Browse files
authored
Fix confusing focus position (#364)
* Fix confusing focus position * v1.6.3
1 parent 33e2101 commit b0458c5

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

packages/cheetah-grid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cheetah-grid",
3-
"version": "1.6.2",
3+
"version": "1.6.3",
44
"description": "Cheetah Grid is a high performance grid engine that works on canvas",
55
"keywords": [
66
"spreadsheet",

packages/cheetah-grid/src/js/core/DrawGrid.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,17 @@ function _onScroll(grid: DrawGrid, _e: Event): void {
908908
left: grid[_].scrollable.scrollLeft,
909909
top: grid[_].scrollable.scrollTop,
910910
};
911+
912+
// If the focus is on the header, recalculate and move the focus position.
913+
const { focus } = grid[_].selection;
914+
const isFrozenCell = grid.isFrozenCell(focus.col, focus.row);
915+
if (
916+
isFrozenCell &&
917+
((isFrozenCell?.col && moveX) || (isFrozenCell?.row && moveY))
918+
) {
919+
grid.setFocusCursor(focus.col, focus.row);
920+
}
921+
911922
const visibleRect = _getVisibleRect(grid);
912923
if (
913924
Math.abs(moveX) >= visibleRect.width ||

packages/vue-cheetah-grid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cheetah-grid",
3-
"version": "1.6.2",
3+
"version": "1.6.3",
44
"description": "Cheetah Grid for Vue.js",
55
"main": "lib/index.js",
66
"unpkg": "dist/vueCheetahGrid.js",

0 commit comments

Comments
 (0)