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