I’m looking for a way to disable an Upload field.
From what I could find setting maxFiles to 0 is the only way.
However I can’t get maxFiles to work with any number.
It doesn’t even work for me in the example in the Vaadin documentation: Upload | Components | Vaadin Docs
Is this a bug in Vaadin?
Version: 24.4.9
Edit: I tried the example on a second computer and it works there. I use Chrome on both computers. This is strange.
Hi, it seems it was a regression. See Upload's setMaxFiles doesn't work. · Issue #6622 · vaadin/flow-components · GitHub. It was fixed a few days away. The fix was already released as part of Vaadin 24.5.0.alpha16 and it’s expected to be released as part of next 24.4 as well.
Also, the issue mentions a workaround to set the property using the element API like this: upload.getElement().executeJs("this.maxFiles = 3;")
2 Likes
The fix mentioned in the previous comment was also released as part of Vaadin 24.4.12.
1 Like