Skip to content
Snippets Groups Projects
Commit 258be2c3 authored by Joseph Weston's avatar Joseph Weston
Browse files

disable preview on file upload dropzones

The docs for react-dropzone say that we have to explicitly
free the 'file preview' to avoid memory leaks in the browser (!).
Presumably disabling previews means we don't have to manage this
ourselves.
parent ee892484
No related branches found
No related tags found
No related merge requests found
......@@ -186,7 +186,11 @@ class Exams extends React.Component {
<h5 className='subtitle'>then we know that to do with PDF's</h5>
<Dropzone accept=".yml, text/yaml, text/x-yaml, application/yaml, application/x-yaml"
style={{}} activeStyle={{borderStyle: 'dashed', width: 'fit-content', margin: 'auto'}} onDrop={this.onDropYAML}>
style={{}} activeStyle={{borderStyle: 'dashed', width: 'fit-content', margin: 'auto'}}
onDrop={this.onDropYAML}
disablePreview="true"
multiple="false"
>
<div className="file has-name is-boxed is-centered">
<label className="file-label">
<span className="file-cta">
......@@ -235,8 +239,11 @@ class Exams extends React.Component {
<Dropzone accept={"application/pdf"} style={{}}
activeStyle={{borderStyle: 'dashed', width: 'fit-content', margin: 'auto'}}
onDrop={this.onDropPDF.bind(this)}
disabled={isDisabled}>
onDrop={this.onDropPDF}
disabled={isDisabled}
disablePreview="true"
multiple="true"
>
<div className="file has-name is-boxed is-centered">
<label className="file-label">
<span className="file-cta" disabled={isDisabled}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment