FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
101 stars 17 forks source link

inputText autofocus does not work when the input type is submit #2925

Open yourlogo2018 opened 2 weeks ago

yourlogo2018 commented 2 weeks ago

Has your issue been reported?

Current Behavior

Bug Description:

When filling in the input and using the "submit" type, the autofocus on the input does not work correctly. I noticed that autofocus only works the first time the page is accessed. After filling out and sending the message (submit) in the input, the field does not return to focus automatically. For it to be in focus again, you need to manually click on the input.

Project Context:

I'm developing a chat project, where it's unfeasible to have to manually click on the input every time to send a new message to the other chat user

https://github.com/FlutterFlow/flutterflow-issues/assets/46033923/090438aa-c936-4512-9c36-6fad0213d132

.

Expected Behavior

Expected behavior:

After sending the message, the input should return to focus automatically, allowing the user to continue typing new messages without having to manually click on the input field.

https://github.com/FlutterFlow/flutterflow-issues/assets/46033923/800b9433-4250-4165-81b0-3868b0d0f99f

This is the expected behavior, when sending the message, the input remains in focus so that new messages can be typed and sent. This is working because I had to export the code and adjust it manually. But I saw several people in the community with the same problem, but many don't understand code like I do. You could even let us edit the code from within Flutterflow, I think it would help a lot, just an ok idea ;)

Steps to Reproduce

  1. Create a page in Flutterflow and add a widget of type inputText, configure and leave autofocus activated and select SEND mode in the subimit type.
  2. Create an action so that this message is sent to an API, or even a conversational chat
  3. Fill in the input with a message.
  4. Send the message using the "submit" type.
  5. Note that the input does not return to focus automatically.

Reproducible from Blank

Bug Report Code (Required)

IT4si8/l8c9NpbxA+KrbbcJB/SAvHHp7RpE8scpFcxQcB4jZP4kQfPfQPxBtTu3gT1ZUeGGcp14GwPD8juLLNMcVB0iVc75Jyc5caRaUQnOWVbWTF7ieSkYnTdxnCHXE0J+3sBJ4Is5sdCES7GGAJ+eyQgXUHYDrDVQ8Sq/LZO4=

Context

Project Context:

I am developing a chat project integrated with WhatsApp, where it is unfeasible to have to manually click on the input every time to send a new message to the other chat user.

https://github.com/FlutterFlow/flutterflow-issues/assets/46033923/12106eb3-b700-456f-a14c-ac9788eef074

Visual documentation

https://github.com/FlutterFlow/flutterflow-issues/assets/46033923/090438aa-c936-4512-9c36-6fad0213d132

Additional Info

No response

Environment

- FlutterFlow version: FlutterFlow v4.1.53+ released May 16, 2024 Flutter version is 3.19.1
- Platform:Desktop
- Browser name and version:(web) Chrome Version 126.0.6468.2 (Official Version) dev 64-bit
- Operating system and version affected: (Desktop) Windows 11 64bits

General

Relative to the time the changes were made, data was lost within

When following my steps to reproduce, data loss happens

msusviela commented 1 week ago

I was able to reproduce the issue, I will send it to the ENG team so they can work on this!

yourlogo2018 commented 1 week ago

@msusviela Thank you master, we are always available to improve the tool, which is top