Set `accept` attribute to `image/*` in ImageUpload (#989)
authorStefano Pigozzi <me@steffo.eu>
Sun, 15 Jan 2023 04:14:16 +0000 (05:14 +0100)
committerGitHub <noreply@github.com>
Sun, 15 Jan 2023 04:14:16 +0000 (09:44 +0530)
commit9a34daa2bc2d3d0a2a1ebadb419b916c7ba1bedd
tree6ecae9c747a3c307f3970f637c19ccc101245536
parente5e3f5f0a3542ce9b0c0205d176b4e05adc602e1
Set `accept` attribute to `image/*` in ImageUpload (#989)

That way, browsers will suggest to the users to upload an image file instead of any kind of file.

The behaviour is in-line with Element's, which specifies the same attribute when selecting an avatar.

Please note that it does not prevent users from uploading non-image files as avatars, as browsers interpret that attribute as a mere suggestion, which can be bypassed in the file select dialog.

Partially fixes #982.
src/app/molecules/image-upload/ImageUpload.jsx