sforkowany z mirror/soapbox
Use native accept='' for FileChooser
rodzic
655fde81e9
commit
4a675be598
|
@ -230,15 +230,14 @@ export class FileChooser extends ImmutablePureComponent {
|
|||
static propTypes = {
|
||||
label: PropTypes.string,
|
||||
hint: PropTypes.string,
|
||||
fileTypes: PropTypes.array,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
fileTypes: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
|
||||
accept: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
|
||||
}
|
||||
|
||||
render() {
|
||||
const { label, hint, fileTypes, ...props } = this.props;
|
||||
const { label, hint, ...props } = this.props;
|
||||
const id = uuidv4();
|
||||
|
||||
return (
|
||||
|
@ -248,7 +247,6 @@ export class FileChooser extends ImmutablePureComponent {
|
|||
<div className='label_input__wrapper'>
|
||||
<input
|
||||
id={id}
|
||||
accept={fileTypes.join(',')}
|
||||
className='file optional'
|
||||
type='file'
|
||||
{...props}
|
||||
|
|
Ładowanie…
Reference in New Issue