Skip to content

Commit

Permalink
Merge pull request #278 from open-formulieren/fix/file-component
Browse files Browse the repository at this point in the history
[OF#2335] Re-display drag&drop on cancel upload
  • Loading branch information
sergei-maertens authored Nov 10, 2022
2 parents 0a5655a + cc83e7f commit 961e987
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/formio/components/FileField.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,19 @@ class FileField extends Formio.Components.components.file {
return super.checkComponentValidity(data, dirty, row, options);
}

abortUpload() {
// Formiojs bug #4555 - After deleting a file, if the drag&drop area had been hidden, it
// doesn't show after deleting.
this.fileDropHidden = false;
}

deleteFile(fileInfo) {
// Regression #1539 because of 77e99358a625a9f242f09aa6368a8b7b2c816e88 - failing
// to pass the `url` prop/option to the Formio WebForm constructor leads to
// `webform.setUrl` not being called, which leads to this.root.formio not being
// defined. This codepath leaves vanilla Formio clueless about sending the
// DELETE request, even though it can just use the global formio object...
// Instead of polluting our global configuratio with a non-sense URL (which also
// Instead of polluting our global configuration with a nonsense URL (which also
// 'enables' saving drafts, for example), we opt to handle the delete call ourselves
// in those cases.
const formio = this.options.formio || (this.root && this.root.formio);
Expand Down

0 comments on commit 961e987

Please sign in to comment.