fix: super weird bug with placeholders (#1159)

This commit is contained in:
Richard Shiue 2025-11-11 09:41:02 +08:00 • committed by GitHub
commit 1c2d58b65a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -388,9 +388,7 @@ class _AppFlowyRichTextState extends State<AppFlowyRichText>
textSpan = adjustTextSpan(textSpan); textSpan = adjustTextSpan(textSpan);
final delta = widget.node.delta; final delta = widget.node.delta;
if (delta != null && delta.isNotEmpty) { if (delta != null && delta.isNotEmpty) {
textSpan = textSpan.updateTextStyle( textSpan = textSpan.copyWith(text: '');
const TextStyle(color: Colors.transparent),
);
} }
return RichText( return RichText(
key: placeholderTextKey, key: placeholderTextKey,
@ -543,14 +541,10 @@ class _AppFlowyRichTextState extends State<AppFlowyRichText>
TextSpan getPlaceholderTextSpan() { TextSpan getPlaceholderTextSpan() {
return TextSpan( return TextSpan(
children: [
TextSpan(
text: widget.placeholderText, text: widget.placeholderText,
style: textStyleConfiguration.text.copyWith( style: textStyleConfiguration.text.copyWith(
height: textStyleConfiguration.lineHeight, height: textStyleConfiguration.lineHeight,
), ),
),
],
); );
} }