diff --git a/frontend/lib/views/chat/chat_input_field.dart b/frontend/lib/views/chat/chat_input_field.dart index 19bf72f06..4901408aa 100644 --- a/frontend/lib/views/chat/chat_input_field.dart +++ b/frontend/lib/views/chat/chat_input_field.dart @@ -22,6 +22,22 @@ class _ChatInputFieldState extends State { final TextEditingController _controller = TextEditingController(); final FocusNode _focusNode = FocusNode(); + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + if (_focusNode.hasFocus && widget.isContinuousMode) { + widget.onContinuousModePressed(); + } + }); + } + + @override + void dispose() { + _focusNode.dispose(); // Dispose of the FocusNode when you're done. + super.dispose(); + } + @override Widget build(BuildContext context) { // Using LayoutBuilder to provide the current constraints of the widget, @@ -54,7 +70,6 @@ class _ChatInputFieldState extends State { // when the content exceeds its maximum height child: SingleChildScrollView( reverse: true, - // TODO: Include tool tip to explain clicking text field will end continuous mode child: TextField( controller: _controller, focusNode: _focusNode,