Skip to content

Avoiding autofocus #133

@miquelbeltran

Description

@miquelbeltran

Hello, we noticed that the LlmChatView will gain focus automatically. Digging into the code I saw that the ChatInput has an autofocus param, which is set to widget.viewModel.suggestions.isEmpty.

To avoid autofocus, the trick I am using is to set suggestions to an array with an empty string, like this:

LlmChatView(
  // rest of the code
  suggestions: [''],
);

The problem with this is that it shows an empty text bubble, like so:

Image

My suggestion would be to expose the autofocus as a parameter, maybe nullable so if null works as it is now.
What do you think? If you think this suggestion makes sense, I can submit a PR.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions