-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageInput.accept has no effect in Chrome on localhost #8508
Comments
Could you try with |
@magicxor I've taken it straight from the docs that:
However, the docs also currently state that we can set In the code, we simply pass the
useDropzone({
accept: {
'image/png': ['.png'],
'text/html': ['.html', '.htm'],
}
}) Can you try with such an |
@slax57 unfortunately, I have tried <ImageInput
label={label}
source={source}
multiple
validate={customValidate}
options={{
accept: ['.png', '.jpg', '.jpeg', '.svg'],
}}
>
<ImageField title={label} />
</ImageInput> <ImageInput
label={label}
source={source}
multiple
validate={customValidate}
accept={['.png', '.jpg', '.jpeg', '.svg']}
>
<ImageField title={label} />
</ImageInput> but it doesn't help either. |
Alright, thanks for your investigations. Here's what I suggest. |
Thank you, I'll look into it. |
What you were expecting:
accept
attribute ofImageInput
always affects file types in the file pickerWhat happened instead:
For some reason, it works as expected in CodeSandbox, but it doesn't work on localhost (there is no limitation by file type).
The bug can be reproduced on Windows (Chrome Version 108.0.5359.99 (Official Build) (64-bit)) and on Ubuntu (google-chrome Version 108.0.5359.124 (Official Build) (64-bit)).
I think it's not a Chrome bug because a plain
<input type="file" accept=".png,.svg,.jpg,.jpeg" />
on the same page works as expected.Steps to reproduce:
yarn install && yarn run start
Related code:
https://github.com/magicxor/react-admin-repro-ImageInput-accept-bug
Environment
The text was updated successfully, but these errors were encountered: