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

fix: set maxFiles to Infinity when setting a MultiFileReceiver #6253

Merged
merged 9 commits into from
May 20, 2024

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Apr 26, 2024

Description

Fixes an issue where the user was unable to select more than one file after switching from a single-file receiver to a multi-file one. It was because the Flow component didn't set the maxFiles client-side property to Infinity – the web component's default value for that property – when a multi-file receiver was set.

Fixes #6227

Type of change

  • Bugfix

setMaxFiles(1);
if (receiver instanceof MultiFileReceiver) {
getElement().removeProperty("maxFiles");
getElement().executeJs("this.maxFiles = Infinity");
Copy link
Contributor Author

@vursen vursen Apr 26, 2024

Choose a reason for hiding this comment

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

Should we rather change the default value for this property in the web component?

Copy link
Contributor Author

@vursen vursen May 14, 2024

Choose a reason for hiding this comment

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

We discussed this internally and decided to go ahead with the current fix for now. We will consider changing the web component's default values later.

@vursen vursen marked this pull request as ready for review May 14, 2024 13:54
@vursen vursen requested a review from web-padawan May 14, 2024 14:00
@vursen vursen requested a review from tomivirkki May 15, 2024 06:53
Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@vursen vursen requested a review from web-padawan May 20, 2024 08:22
@vursen vursen merged commit 4876819 into main May 20, 2024
5 checks passed
@vursen vursen deleted the upload/remove-max-files-correctly branch May 20, 2024 08:42
vursen added a commit that referenced this pull request May 20, 2024
#6304)

Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
vursen added a commit that referenced this pull request May 20, 2024
#6303)

Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload: Switching to Single file receiver and then back to MultiFileReceiver prevents adding multiple files
3 participants