Issue with submitting meta fields
See original GitHub issueI use uppy dashboard for uploading images. I’m trying to require people to enter some metadata for each image before submitting to the server. However if i edit a file and try to save the metadata, nothing happens.
I need a few different type of HTML elements that’s why i’m using render function as documented on the uppy website.
An example of some of my metaFields:
metaFields: [
{
id: 'name',
name: '{{ ('uppy.fields.name') | trans | raw }}',
render ({ value, onChange, required, fieldCSSClasses, form }, h) {
return h('input', {
id: 'uppy-Dashboard-FileCard-input-name',
"data-form": form,
type: 'text',
class: fieldCSSClasses.text + ' form-control',
onChange: (ev) => onChange(ev.target.value),
value: value,
placeholder: '{{ ('uppy.placeholder.name') | trans | raw }}',
required,
});
},
},
{
id: 'active',
name: '{{ ('uppy.fields.active') | trans | raw }}',
render: ({value, onChange, form}, h) => {
let select_options = [
h('option', {value: ''}, '{{ ('general.yes') | trans | raw }}'),
h('option', {value: 'no'}, '{{ ('general.no') | trans | raw }}')
]
return h('select', {
id: 'uppy-Dashboard-FileCard-select-active',
"data-form": form,
class: 'uppy-c-textInput uppy-Dashboard-FileCard-input form-control',
onChange: (ev) => onChange(ev.target.value),
value: value
}, select_options)
},
},
]
I’ve been stuck on this for a few hours now. And what i’ve noticed is that on the dashboard example on uppy website the input fields contain a form attribute, and by looking at the uppy code i’ve noticed that you can get the form id as a parameter. So i’ve been trying to add this to my input fields, but this hasn’t worked for me yet…
I’m using symfony/twig so some options contain twig variables with translate strings.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Pardon me for assuming this is a question and not a bug. This is now confirmed and also discussed in #3111. I’m closing this as a duplicate. Thanks for reporting.
This should have been fixed in the recent patch release,
1.31.1
, please upgrade@uppy/core
and@uppy/dashboard
and let us know if it worked for you. Thanks for reporting!