Skip to content

Commit

Permalink
Merge pull request #2045 from VisActor/2039-bug-editInputPosition
Browse files Browse the repository at this point in the history
2039 bug edit input position
  • Loading branch information
fangsmile committed Jul 5, 2024
2 parents 5368718 + 24adcc7 commit d3e614c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: disable select and edit input should move when input is outside of table #2039\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
8 changes: 4 additions & 4 deletions packages/vtable/examples/editor/input-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ export function createTable() {
const instance = new ListTable(option);

//设置表格数据
// instance.setRecords(personsDataSource, {
// field: 'progress',
// order: 'desc'
// });
instance.setRecords(personsDataSource, {
field: 'progress',
order: 'desc'
});

instance.on('change_cell_value', arg => {
console.log(arg);
Expand Down
3 changes: 3 additions & 0 deletions packages/vtable/src/state/select/update-position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export function updateSelectPosition(
const { highlightScope, disableHeader, cellPos } = state.select;

if ((disableHeader && table.isHeader(col, row)) || highlightScope === 'none') {
if (col !== -1 && row !== -1 && !isSelectMoving) {
table._makeVisibleCell(col, row);
}
col = -1;
row = -1;
}
Expand Down

0 comments on commit d3e614c

Please sign in to comment.