Skip to content

Commit

Permalink
feat(reply_bar): show hint text when current reply content is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Oct 4, 2024
1 parent dd7e790 commit c6e68e1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/widgets/reply_bar/reply_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ class _ReplyBarWrapperState extends State<ReplyBar> {
controller: controller,
readOnly: true,
enabled: onTapCallback != null,
decoration:
InputDecoration(hintText: context.t.threadPage.sendReplyHint),
onTap: onTapCallback,
),
),
Expand Down Expand Up @@ -635,9 +637,12 @@ final class _ReplyBarState extends State<_ReplyBar> with LoggerMixin {
_replyFocusNode.dispose();
_authStatusSub.cancel();
final text = _replyRichController.toBBCode();
WidgetsBinding.instance.addPostFrameCallback((_) {
widget.outerTextController.text = text;
});
if (text.trim().isNotEmpty) {
// Only save text that intend to reply when that text is not empty.
WidgetsBinding.instance.addPostFrameCallback((_) {
widget.outerTextController.text = text;
});
}
_replyRichController
..removeListener(_checkEditorContent)
..dispose();
Expand Down

0 comments on commit c6e68e1

Please sign in to comment.