fix: multiple line editor bugs (#9760)

Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Omar Brikaa
2025-07-24 10:11:04 +03:00
committed by GitHub
parent f38f381989
commit 416da62138
4 changed files with 37 additions and 29 deletions

View File

@@ -225,8 +225,11 @@ export const actionDeleteSelected = register({
return false;
}
// case: deleting last remaining point
if (element.points.length < 2) {
// case: deleting all points
if (
element.points.length < 2 ||
selectedPointsIndices.length === element.points.length
) {
const nextElements = elements.map((el) => {
if (el.id === element.id) {
return newElementWith(el, { isDeleted: true });