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

Allow using send button when there is no message text #136

Open
singpolyma opened this issue Nov 29, 2023 · 3 comments
Open

Allow using send button when there is no message text #136

singpolyma opened this issue Nov 29, 2023 · 3 comments

Comments

@singpolyma
Copy link

In my app sometimes a user can attach a file, then push send, without typing a message. I can use sendDisabled to make the button become enabled when there is an attachment, but clicking it does not trigger the onSend handler because of https://github.com/chatscope/chat-ui-kit-react/blob/master/src/components/MessageInput/MessageInput.jsx#L134

I think this check should be replaced with a sendDisabled check, or no check since the button disablement should be enough to prevent this from being called when we don't want it.

@PavelKudrautsau
Copy link

This is just as interesting to me, hint how to implement it

@PavelKudrautsau
Copy link

@singpolyma please you can help with it?

@supersnager
Copy link
Contributor

supersnager commented Apr 15, 2024

I think this behavior should be controlled by dedicated flag.
For now as a workaround you can set <MessageInput sendButton={false} />, and use custom send button like in this story:
Wrapped MessageInput

Related issue: #7

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