From f06e063f03500b0a1335cef0e83c246fed2c143c Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:45:42 +0100 Subject: [PATCH] Fix a bug when dismissing a media preview. (#1428) --- ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift | 1 + changelog.d/pr-1428.bugfix | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog.d/pr-1428.bugfix diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift index 014c47574..fe15e1042 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift @@ -256,6 +256,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol switch action { case .displayMediaFile(let file, let title): + state.bindings.composerFocused = false // Hide the keyboard otherwise a big white space is sometimes shown when dismissing the preview. state.bindings.mediaPreviewItem = MediaPreviewItem(file: file, title: title) case .displayLocation(let body, let geoURI, let description): callback?(.displayLocation(body: body, geoURI: geoURI, description: description)) diff --git a/changelog.d/pr-1428.bugfix b/changelog.d/pr-1428.bugfix new file mode 100644 index 000000000..c2d77f0ff --- /dev/null +++ b/changelog.d/pr-1428.bugfix @@ -0,0 +1 @@ +Fix a bug where media previews would sometimes dismiss to show the timeline with a big empty space at the bottom. \ No newline at end of file