From 4b16a692756e941fd04fdbf4be0f1575c8a2a8b5 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 16 May 2023 13:02:28 -0400 Subject: [PATCH] Fix expand focused attachment animation not working --- .../Sources/ComposeUI/Controllers/ComposeController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift index 51d55d50..c1d645c0 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift @@ -339,8 +339,10 @@ public final class ComposeController: ViewController { }, message: { error in Text(error.localizedDescription) }) - .matchedGeometryPresentation(id: Binding(get: { - controller.focusedAttachment?.0.id + .matchedGeometryPresentation(id: Binding(get: { () -> UUID?? in + let id = controller.focusedAttachment?.0.id + // this needs to be a double optional, since the type used for for the presentationID in the geom source is a UUID? + return id.map { Optional.some($0) } }, set: { if $0 == nil { controller.focusedAttachment = nil