The MediaUpload component gallery and allowedTypes attributes do not function as documented when used in combination. If gallery is used, effective allowedTypes appears to always be image.
This forces major development efforts to replicate the same functionality where other file types are in play, as with Document Gallery for example.
Step-by-step reproduction instructions
Create MediaUpload element with below configuration and non-image files available. Confirm that the available files in dialog are exclusively images.
Description
The
MediaUpload
componentgallery
andallowedTypes
attributes do not function as documented when used in combination. Ifgallery
is used, effectiveallowedTypes
appears to always beimage
.This forces major development efforts to replicate the same functionality where other file types are in play, as with Document Gallery for example.
Step-by-step reproduction instructions
Create MediaUpload element with below configuration and non-image files available. Confirm that the available files in dialog are exclusively images.
Create MediaUpload element with below configuration and non-image files available. Confirm that all files are displayed in dialog.
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes