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
Branches
Tags
No related merge requests found
...@@ -186,7 +186,11 @@ class Exams extends React.Component { ...@@ -186,7 +186,11 @@ class Exams extends React.Component {
<h5 className='subtitle'>then we know that to do with PDF's</h5> <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" <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"> <div className="file has-name is-boxed is-centered">
<label className="file-label"> <label className="file-label">
<span className="file-cta"> <span className="file-cta">
...@@ -235,8 +239,11 @@ class Exams extends React.Component { ...@@ -235,8 +239,11 @@ class Exams extends React.Component {
<Dropzone accept={"application/pdf"} style={{}} <Dropzone accept={"application/pdf"} style={{}}
activeStyle={{borderStyle: 'dashed', width: 'fit-content', margin: 'auto'}} activeStyle={{borderStyle: 'dashed', width: 'fit-content', margin: 'auto'}}
onDrop={this.onDropPDF.bind(this)} onDrop={this.onDropPDF}
disabled={isDisabled}> disabled={isDisabled}
disablePreview="true"
multiple="true"
>
<div className="file has-name is-boxed is-centered"> <div className="file has-name is-boxed is-centered">
<label className="file-label"> <label className="file-label">
<span className="file-cta" disabled={isDisabled}> <span className="file-cta" disabled={isDisabled}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment