Use native accept='' for FileChooser
This commit is contained in:
parent
655fde81e9
commit
4a675be598
1 changed files with 2 additions and 4 deletions
|
@ -230,15 +230,14 @@ export class FileChooser extends ImmutablePureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
label: PropTypes.string,
|
label: PropTypes.string,
|
||||||
hint: PropTypes.string,
|
hint: PropTypes.string,
|
||||||
fileTypes: PropTypes.array,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
fileTypes: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
|
accept: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { label, hint, fileTypes, ...props } = this.props;
|
const { label, hint, ...props } = this.props;
|
||||||
const id = uuidv4();
|
const id = uuidv4();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -248,7 +247,6 @@ export class FileChooser extends ImmutablePureComponent {
|
||||||
<div className='label_input__wrapper'>
|
<div className='label_input__wrapper'>
|
||||||
<input
|
<input
|
||||||
id={id}
|
id={id}
|
||||||
accept={fileTypes.join(',')}
|
|
||||||
className='file optional'
|
className='file optional'
|
||||||
type='file'
|
type='file'
|
||||||
{...props}
|
{...props}
|
||||||
|
|
Loading…
Reference in a new issue