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.
<Text variant="b3">{uploadPromise ? 'Cancel' : 'Remove'}</Text>
</button>
)}
- <input onChange={uploadImage} style={{ display: 'none' }} ref={uploadImageRef} type="file" />
+ <input onChange={uploadImage} style={{ display: 'none' }} ref={uploadImageRef} type="file" accept="image/*" />
</div>
);
}