Use native accept='' for FileChooser

stable/1.0.x
Alex Gleason 2020-04-22 18:15:50 -05:00
rodzic 655fde81e9
commit 4a675be598
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 2 dodań i 4 usunięć

Wyświetl plik

@ -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}