From ece59edcbf711545e62b839ce9fa4bce7db6f996 Mon Sep 17 00:00:00 2001 From: jimmyshiau Date: Wed, 17 Sep 2025 17:49:26 +0800 Subject: [PATCH] Fixed no underline displayed for characters being converted with IME within a hasEmbed line on iOS --- lib/src/document/nodes/node.dart | 2 ++ lib/src/editor/widgets/text/text_line.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/document/nodes/node.dart b/lib/src/document/nodes/node.dart index 947d3f1dc..45ba7a58f 100644 --- a/lib/src/document/nodes/node.dart +++ b/lib/src/document/nodes/node.dart @@ -51,6 +51,8 @@ abstract base class Node extends LinkedListEntry { Node clone() => newInstance()..applyStyle(style); + Node cloneWithOffset() => clone()..parent = parent.._offset = offset; + int? _offset; /// Offset in characters of this node relative to [parent] node. diff --git a/lib/src/editor/widgets/text/text_line.dart b/lib/src/editor/widgets/text/text_line.dart index ee09dcc49..c5d4f06d6 100644 --- a/lib/src/editor/widgets/text/text_line.dart +++ b/lib/src/editor/widgets/text/text_line.dart @@ -251,7 +251,7 @@ class _TextLineState extends State { } // here child is Text node and its value is cloned - textNodes.add(child.clone()); + textNodes.add(child.cloneWithOffset()); } if (textNodes.isNotEmpty) {