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