mirror of
https://github.com/AppFlowy-IO/AppFlowy
synced 2026-05-24 09:38:25 +00:00
fix: delete text in single line
This commit is contained in:
parent
d058f2d591
commit
c65f2e1b38
1 changed files with 13 additions and 5 deletions
|
|
@ -50,11 +50,19 @@ FlowyKeyEventHandler deleteTextHandler = (editorState, event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
transactionBuilder.deleteText(
|
if (selection.isCollapsed) {
|
||||||
textNode,
|
transactionBuilder.deleteText(
|
||||||
selection.start.offset - 1,
|
textNode,
|
||||||
1,
|
selection.start.offset - 1,
|
||||||
);
|
1,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
transactionBuilder.deleteText(
|
||||||
|
textNode,
|
||||||
|
selection.start.offset,
|
||||||
|
selection.end.offset - selection.start.offset,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final first = textNodes.first;
|
final first = textNodes.first;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue