Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: flowy_rich_text will not automatically wrap when the text exceeds a line

Lucas.Xu9b9de523da60
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart
index fcba91c3c9..75cde60e39 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart
@@ -62,11 +62,13 @@ class _BulletedListTextNodeWidgetState extends State<BulletedListTextNodeWidget>
size: Size.square(leftPadding),
name: 'point',
),
- FlowyRichText(
- key: _richTextKey,
- placeholderText: 'List',
- textNode: widget.textNode,
- editorState: widget.editorState,
+ Expanded(
+ child: FlowyRichText(
+ key: _richTextKey,
+ placeholderText: 'List',
+ textNode: widget.textNode,
+ editorState: widget.editorState,
+ ),
),
],
);
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart
index ee64084901..065ae8b595 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart
@@ -82,13 +82,15 @@ class _CheckboxNodeWidgetState extends State<CheckboxNodeWidget>
..commit();
},
),
- FlowyRichText(
- key: _richTextKey,
- placeholderText: 'To-do',
- textNode: widget.textNode,
- textSpanDecorator: _textSpanDecorator,
- editorState: widget.editorState,
- )
+ Expanded(
+ child: FlowyRichText(
+ key: _richTextKey,
+ placeholderText: 'To-do',
+ textNode: widget.textNode,
+ textSpanDecorator: _textSpanDecorator,
+ editorState: widget.editorState,
+ ),
+ ),
],
);
}
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart
index eb03846711..dbf4e5f63c 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart
@@ -141,10 +141,7 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
return Stack(
children: [
_buildPlaceholderText(context),
- Align(
- alignment: Alignment.centerLeft,
- child: _buildSingleRichText(context),
- )
+ _buildSingleRichText(context),
],
);
}
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/heading_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/heading_text.dart
index aacdd9f903..2511349e4d 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/heading_text.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/heading_text.dart
@@ -63,13 +63,15 @@ class _HeadingTextNodeWidgetState extends State<HeadingTextNodeWidget>
top: topPadding,
bottom: bottomPadding,
),
- child: FlowyRichText(
- key: _richTextKey,
- placeholderText: 'Heading',
- placeholderTextSpanDecorator: _placeholderTextSpanDecorator,
- textSpanDecorator: _textSpanDecorator,
- textNode: widget.textNode,
- editorState: widget.editorState,
+ child: Expanded(
+ child: FlowyRichText(
+ key: _richTextKey,
+ placeholderText: 'Heading',
+ placeholderTextSpanDecorator: _placeholderTextSpanDecorator,
+ textSpanDecorator: _textSpanDecorator,
+ textNode: widget.textNode,
+ editorState: widget.editorState,
+ ),
),
)
],
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart
index 12d95f8c9a..e9fed70c54 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart
@@ -63,11 +63,13 @@ class _NumberListTextNodeWidgetState extends State<NumberListTextNodeWidget>
size: Size.square(leftPadding),
number: widget.textNode.attributes.number,
),
- FlowyRichText(
- key: _richTextKey,
- placeholderText: 'List',
- textNode: widget.textNode,
- editorState: widget.editorState,
+ Expanded(
+ child: FlowyRichText(
+ key: _richTextKey,
+ placeholderText: 'List',
+ textNode: widget.textNode,
+ editorState: widget.editorState,
+ ),
),
],
);
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart
index a3b6d2ca79..00bb393652 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart
@@ -65,11 +65,13 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
),
name: 'quote',
),
- FlowyRichText(
- key: _richTextKey,
- placeholderText: 'Quote',
- textNode: widget.textNode,
- editorState: widget.editorState,
+ Expanded(
+ child: FlowyRichText(
+ key: _richTextKey,
+ placeholderText: 'Quote',
+ textNode: widget.textNode,
+ editorState: widget.editorState,
+ ),
),
],
);