collective / volto-form-block

Volto addon for a customizable form block
MIT License
9 stars 8 forks source link

Bug: Cant submit form when using drag-and-drop on required attachment field #111

Open mbarde opened 3 months ago

mbarde commented 3 months ago

What?

If a form has a required attachment field, it can not be submitted when user inputs file via drag-and-drop.

Steps to reproduce

  1. Create form
  2. Add attachment field
  3. Mark it as required
  4. Save
  5. Drag-and-drop file into this attachment field
  6. Try to submit form
  7. Nothing happens

Tested in Firefox and Chrome.

Versions

mbarde commented 3 months ago

Reason seems to be that the browsers form validation does not recognize the field as filled when using drag-and-drop on it.

I create a PR with a fix that basically just adds a dummy file to the relevant input element to solve this issue: https://github.com/collective/volto-form-block/pull/112

Would be nice if someone could confirm this issue and my fix.