Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2039 bug edit input position #2045

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "[email protected]"
}
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
Loading