Skip to content

Commit c4dc6b0

Browse files
committed
fix: Discard initial selection for single select
Workaround existing logic that dismisses the dialog if `allowMuliple` is true and selection is not empty. The existing logic allows for quickly selecting a single media item, but inhibits the ability to showcase a pre-existing selection for single-select contexts. This diverges from the web experience, but is the easiest path forward to avoid a significant refactor of the logic that would impact all other existing use cases--Gutenberg Mobile, Aztec, etc.
1 parent ea862c0 commit c4dc6b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WordPress/Classes/ViewRelated/Media/SiteMedia/Controllers/SiteMediaCollectionViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ final class SiteMediaCollectionViewController: UIViewController, NSFetchedResult
175175
self.allowsMultipleSelection = allowsMultipleSelection
176176
self.isSelectionOrdered = isSelectionOrdered
177177

178-
if let selectedMedia = initialSelection {
178+
if let selectedMedia = initialSelection, allowsMultipleSelection {
179179
setInitialSelection(selectedMedia)
180180
} else {
181181
deselectAll()

0 commit comments

Comments
 (0)