fix undo insert image on empty asset

pull/298/head
li3317 4 years ago
parent 2aa577ca58
commit cdd88241a6
  1. 4
      lib/src/widgets/controller.dart

@ -79,13 +79,13 @@ class QuillController extends ChangeNotifier {
}
void _handleHistoryChange(int? len) {
if (len != 0) {
if (len! > 0) {
// if (this.selection.extentOffset >= document.length) {
// // cursor exceeds the length of document, position it in the end
// updateSelection(
// TextSelection.collapsed(offset: document.length), ChangeSource.LOCAL);
updateSelection(
TextSelection.collapsed(offset: selection.baseOffset + len!),
TextSelection.collapsed(offset: selection.baseOffset + len),
ChangeSource.LOCAL);
} else {
// no need to move cursor

Loading…
Cancel
Save