@@ -140,19 +140,27 @@ class _ReplyBarWrapperState extends State<ReplyBar> {
140140 onTapCallback = showEditor;
141141 }
142142
143- return ColoredBox (
144- color: Theme .of (context).colorScheme.surfaceContainerLow,
145- child: Padding (
146- padding: edgeInsetsL12T12R12B12,
147- child: TextField (
148- controller: controller,
149- readOnly: true ,
150- enabled: onTapCallback != null ,
151- decoration: InputDecoration (
152- hintText: context.t.threadPage.sendReplyHint,
153- border: const UnderlineInputBorder (),
143+ return BlocListener <ReplyBloc , ReplyState >(
144+ listener: (_, state) {
145+ // Clear the outer controller text.
146+ if (state.status == ReplyStatus .success) {
147+ controller.clear ();
148+ }
149+ },
150+ child: ColoredBox (
151+ color: Theme .of (context).colorScheme.surfaceContainerLow,
152+ child: Padding (
153+ padding: edgeInsetsL12T12R12B12,
154+ child: TextField (
155+ controller: controller,
156+ readOnly: true ,
157+ enabled: onTapCallback != null ,
158+ decoration: InputDecoration (
159+ hintText: context.t.threadPage.sendReplyHint,
160+ border: const UnderlineInputBorder (),
161+ ),
162+ onTap: onTapCallback,
154163 ),
155- onTap: onTapCallback,
156164 ),
157165 ),
158166 );
@@ -664,7 +672,7 @@ final class _ReplyBarState extends State<_ReplyBar> with LoggerMixin {
664672 listener: (context, state) {
665673 // Clear text one time when user send request succeed.
666674 if (state.status == ReplyStatus .success && state.needClearText) {
667- _replyRichController.clear ();
675+ _replyRichController.clearWithoutRequestingFocus ();
668676 // Reset flag because we only want to clear the sent text.
669677 context.read <ReplyBloc >().add (ReplyResetClearTextStateTriggered ());
670678 _clearTextAndHint ();
0 commit comments