feat: move cursor after inserting video/image (#1739)

pull/1745/head
kiwamizamurai 1 year ago committed by GitHub
parent dd374fcfff
commit d64fd9a47a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      flutter_quill_extensions/lib/extensions/controller_ext.dart

@ -24,7 +24,8 @@ extension QuillControllerExt on QuillController {
length,
BlockEmbed.image(imageSource),
null,
);
)
..moveCursorToPosition(index + 1);
}
/// Insert video embed block, it requires the [videoUrl]
@ -39,6 +40,7 @@ extension QuillControllerExt on QuillController {
}) {
this
..skipRequestKeyboard = true
..replaceText(index, length, BlockEmbed.video(videoUrl), null);
..replaceText(index, length, BlockEmbed.video(videoUrl), null)
..moveCursorToPosition(index + 1);
}
}

Loading…
Cancel
Save