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

SendButton in multimodal-input Sends Only the First Character #636

Open
bolshiyanov opened this issue Dec 18, 2024 · 3 comments
Open

SendButton in multimodal-input Sends Only the First Character #636

bolshiyanov opened this issue Dec 18, 2024 · 3 comments

Comments

@bolshiyanov
Copy link

Description

There is an issue with the SendButton in the multimodal-input component. When a message is written in the textArea and ready to be sent, there are two options to trigger the request:

  1. Pressing the Enter key;
  2. Clicking the SendButton.
  • Expected behavior: The full text from the textArea should be sent to the server in both cases.
  • Actual behavior:
    • When pressing Enter: The complete text is successfully sent.
    • When clicking the SendButton: Only the first character of the textArea content is sent to the server.

Steps to Reproduce

  1. Open the component with the multimodal-input.
  2. Type a message (e.g., "Hello, world!") in the textArea.
  3. Click the SendButton.
  4. Observe that only the first character ("H") is sent to the server.

Environment

  • Library: OpenAI API integration
  • Component: multimodal-input
  • Issue Source: SendButton

Additional Context

  • No errors appear in the console during this interaction.
  • Pressing Enter behaves as expected, suggesting that the issue might be related to the event handling or state update when the SendButton is clicked.
    Screenshot 2024-12-18 180752
    Screenshot 2024-12-18 180836
@athrael-soju
Copy link

athrael-soju commented Dec 19, 2024

@bolshiyanov Quick fix: athrael-soju#8

I'm basically removing the memoization for SendButton

@michaelwlt
Copy link

michaelwlt commented Dec 19, 2024

@athrael-soju You don't actually need to drop the support. Check out my fix on codeberg: https://codeberg.org/michaelwlt/bettergptv2/commit/33706d1bc1ccc96d3a4022610313f9a1a215b720

@bolshiyanov
Copy link
Author

It looks like this is working as expected, thanks

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

No branches or pull requests

3 participants