Update replaceText method

pull/75/head
Xin Yao 4 years ago
parent 9f4c1cf73f
commit 17a38965c8
  1. 5
      lib/widgets/controller.dart

@ -86,11 +86,12 @@ class QuillController extends ChangeNotifier {
print('document.replace failed: $e');
throw e;
}
if (delta != null &&
final shouldRetainDelta = delta != null &&
toggledStyle.isNotEmpty &&
delta.isNotEmpty &&
delta.length <= 2 &&
delta.last.isInsert) {
delta.last.isInsert;
if (shouldRetainDelta) {
Delta retainDelta = Delta()
..retain(index)
..retain(data is String ? data.length : 1, toggledStyle.toJson());

Loading…
Cancel
Save