diff --git a/lib/src/widgets/proxy.dart b/lib/src/widgets/proxy.dart index 85a2a613..a1cb8c6a 100644 --- a/lib/src/widgets/proxy.dart +++ b/lib/src/widgets/proxy.dart @@ -103,8 +103,9 @@ class RenderEmbedProxy extends RenderProxyBox implements RenderContentProxyBox { @override Offset getOffsetForCaret(TextPosition position, Rect? caretPrototype) { - assert(position.offset == 1 || position.offset == 0); - return position.offset == 0 + assert( + position.offset == 1 || position.offset == 0 || position.offset == -1); + return position.offset <= 0 ? Offset.zero : Offset( size.width - (caretPrototype == null ? 0 : caretPrototype.width),