Skip to content

'multiple' property of MediaUpload misdocumented as boolean #9137

@LuigiPulcini

Description

@LuigiPulcini

The multiple property of the MediaUpload is mistakenly documented as being boolean here in Gutenberg and in several different WordPress files.

In the gallery-add.js controller, the property is even commented as follows: @todo 'add' doesn't seem to do anything special, and gets used as a boolean.

It is worth noting, though, that the property accepts both true and the string value 'add' with two noticeably different behaviors:

multiple = true: makes it possible to select multiple items in the Media library but, by default, clicking on the thumbnail of an item automatically deselect the previously selected item. In order to select multiple items, it is necessary to click with SHIFT or CMD/CTRL

multiple = 'add': makes it possible to select multiple items in the Media library and items keep being added simply clicking on their thumbnails, without any need to use the SHIFT or the CMD/CTRL key. In order to deselect a selected item, one can simply click on its correspondent check mark.

I believe this difference could be better documented in both projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions