Merge pull request #789 from lbryio/featureTesting
Attempt to fix Facebook's browser file picker
This commit is contained in:
commit
85cde161de
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.handleFileInput = this.handleFileInput.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) {
|
||||
|
@ -200,11 +209,12 @@ class Dropzone extends React.Component {
|
|||
)}
|
||||
<form>
|
||||
<input
|
||||
ref={this.fileInput}
|
||||
className='input-file'
|
||||
type='file'
|
||||
id='file_input'
|
||||
name='file_input'
|
||||
{...(isFacebook ? { accept: 'image/*' } : { accept: 'video/*,image/*' })}
|
||||
accept='video/*,image/*'
|
||||
onChange={this.handleFileInput}
|
||||
encType='multipart/form-data'
|
||||
/>
|
||||
|
|
Loading…
Add table
Reference in a new issue