commit
83022b4095
1 changed files with 11 additions and 1 deletions
|
@ -46,6 +46,15 @@ class Dropzone extends React.Component {
|
||||||
this.handleClick = this.handleClick.bind(this);
|
this.handleClick = this.handleClick.bind(this);
|
||||||
this.handleFileInput = this.handleFileInput.bind(this);
|
this.handleFileInput = this.handleFileInput.bind(this);
|
||||||
this.chooseFile = this.chooseFile.bind(this);
|
this.chooseFile = this.chooseFile.bind(this);
|
||||||
|
|
||||||
|
this.fileInput = React.createRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
if(isFacebook) {
|
||||||
|
// See https://github.com/lbryio/spee.ch/issues/782
|
||||||
|
this.fileInput.current.removeAttribute('accept');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
|
@ -200,11 +209,12 @@ class Dropzone extends React.Component {
|
||||||
)}
|
)}
|
||||||
<form>
|
<form>
|
||||||
<input
|
<input
|
||||||
|
ref={this.fileInput}
|
||||||
className='input-file'
|
className='input-file'
|
||||||
type='file'
|
type='file'
|
||||||
id='file_input'
|
id='file_input'
|
||||||
name='file_input'
|
name='file_input'
|
||||||
{...(isFacebook ? { accept: 'image/*' } : { accept: 'video/*,image/*' })}
|
accept='video/*,image/*'
|
||||||
onChange={this.handleFileInput}
|
onChange={this.handleFileInput}
|
||||||
encType='multipart/form-data'
|
encType='multipart/form-data'
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue