fix selection bug for empty portal table
This commit is contained in:
parent
e376582f12
commit
a341a317fc
1 changed files with 9 additions and 3 deletions
|
|
@ -201,7 +201,7 @@
|
||||||
{ additive }: { additive?: boolean } = {},
|
{ additive }: { additive?: boolean } = {},
|
||||||
) {
|
) {
|
||||||
if (!lazy_data || selections.length === 0) {
|
if (!lazy_data || selections.length === 0) {
|
||||||
console.warn("move_selection() preconditions not met");
|
console.warn("move_cursor() preconditions not met");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -547,8 +547,14 @@
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (lazy_data.rows.length > 0 && lazy_data.fields.length > 0) {
|
if (lazy_data.fields.length > 0) {
|
||||||
set_selections([{ region: "main", row_idx: 0, field_idx: 0 }]);
|
set_selections([
|
||||||
|
{
|
||||||
|
region: lazy_data.rows.length > 0 ? "main" : "inserter",
|
||||||
|
row_idx: 0,
|
||||||
|
field_idx: 0,
|
||||||
|
},
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
})().catch(console.error);
|
})().catch(console.error);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue