AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
End continuous mode when clicking text field
hunteraraujo27e9868aa50e
diff --git a/frontend/lib/views/chat/chat_input_field.dart b/frontend/lib/views/chat/chat_input_field.dartindex 19bf72f06e..4901408aaf 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<ChatInputField> {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();+ }+@overrideWidget build(BuildContext context) {// Using LayoutBuilder to provide the current constraints of the widget,@@ -54,7 +70,6 @@ class _ChatInputFieldState extends State<ChatInputField> {// when the content exceeds its maximum heightchild: SingleChildScrollView(reverse: true,- // TODO: Include tool tip to explain clicking text field will end continuous modechild: TextField(controller: _controller,focusNode: _focusNode,