Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove the disable state from chat input box #1341

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kang-square
Copy link

@kang-square kang-square commented Feb 22, 2025

This PR is to implement the feature mentioned in this issue.
I remove the disable state from the chat input box, while the Goose is generating.
The Enter shortcut to submit is still disabled when Goose is generating.

Screen.Recording.2025-02-22.at.12.42.08.AM-1.mov

@kang-square kang-square changed the title remove the disable state feat: remove the disable state from chat input box Feb 22, 2025
onClick={onStop}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add preventDefault and stopPropagation here, otherwise it triggers a bug when Goose is generating, and there is text in the input box, and you click on the stop button, the text is submitted.
I guess it's because when we clicks on the stop button, the isLoading changes from true to false, and it renders the submit button. When the click event bubble up, its parent element is the form, so it triggers the form submit.

@kang-square kang-square marked this pull request as ready for review February 22, 2025 05:47
@wendytang wendytang requested a review from lily-de February 24, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant