better fix for iPhone 14

This commit is contained in:
Mauro Romito
2022-11-30 14:04:38 +01:00
parent 7bb758ad3e
commit 8960197329

View File

@@ -296,13 +296,8 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
private func updateTextViewHeight() {
let height = UIScreen.main.bounds.height
let barOffset: CGFloat
if let topSafeArea = window?.safeAreaInsets.top, topSafeArea >= 68 {
barOffset = topSafeArea
} else {
barOffset = 68
}
let toolbarHeight: CGFloat = 96
let barOffset: CGFloat = 68
let toolbarHeight: CGFloat = sendMode == .send ? 96 : 110
let finalHeight = height - keyboardHeight - toolbarHeight - barOffset
wysiwygViewModel.maxExpandedHeight = finalHeight
if finalHeight < 200 {
@@ -347,6 +342,7 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
set {
viewModel.sendMode = ComposerSendMode(from: newValue)
updatePlaceholderText()
updateTextViewHeight()
}
}