vaadin/flow-components

Upload is missing isReadOnly

sveinnetnordic opened this issue · 5 comments

Describe your motivation

Found it missing

Describe the solution you'd like

Button and drop filed should be marked readonly and drop should not be allowed

Describe alternatives you've considered

No response

Additional context

No response

A kind of a workaround, not pretty because the field change:

uploadField.element.isEnabled = false
uploadField.isDropAllowed = false

A better workaround is this then:
uploadField.maxFiles = if (it.value) 0 else 1
but need to set it correct for multi/single, and the button changes form Upload file... to Upload files...

Upload does not have field nature, but it can be used in a custom field. There is an example of using Upload component in CustomField here

https://stackoverflow.com/questions/66154593/vaadin-upload-component-in-binder-e-g-crud-editor

Upload does not have field nature, but it can be used in a custom field. There is an example of using Upload component in CustomField here

https://stackoverflow.com/questions/66154593/vaadin-upload-component-in-binder-e-g-crud-editor

Setting new UploadField() readonly did not have any effect