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
Limit the number of attachments selected #565
Comments
Thanks for reporting this, currently API limits the number of attachments to a maximum of 10 for each message, we will put a reflect this limit in our components soon. |
Thanks @mahboubii I just found this prop we can use on the Channel component I would suggest to perhaps changing this text
You have reached the max number of attachments per message or something like that.
Also if possible could the FileUploadButton https://github.com/GetStream/react-file-utils/blob/master/src/components/FileUploadButton.js have a class when disabled, so we can perhaps change the color of the icon to make it look disabled too. And looks like there is a bug with |
@alexlopezit problem is that it disables when you reach the limit, but as long as you haven't reached the limit it allows you to add multiple files that will get you across that limit. We're looking into a solution for this. Visual indication is something we will definitely add as well. |
@alexlopezit fixed in v3.1.5 |
Hi @jaapbakker88 and @mahboubii , I just checked this on v3.1.6 and though it was not working until I manually added the prop |
@alexlopezit unfortunately we weren't able to reproduce the issue. are you using the add file button or the drag&drop option? |
I did some more digging and found that there's a bug in @alexlopezit The only way I was able to reproduce the problem you described is by first dragging less than the maximum number of files into the dropzone, and then dragging another set of files into it so that the total number of files exceeds the specified max (or, in case no maximum is provided, the default value of 10 files). Could you confirm that this is what triggers the bug for you? |
Hi @ath92 and @mahboubii , |
@alexlopezit we've released a fix for this issue in version |
Awesome @jaapbakker88 , just tested it and worked perfect. Thanks |
Is there is any way we can prevent the user to select more than 10 attachments as it seems that is the limit when sending a message to the server, at the moment you can select more than that and then send the message which will fail, then clicking the link
Message failed. Click to try again.
will simply keep failing in the background and the users does not know why, also there is no way to remove this failed message from the UI witch is a bit confusing, unless you refresh the page.gz#6534
The text was updated successfully, but these errors were encountered: