diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift index 1f88a0bab..bc5af6d29 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift @@ -207,7 +207,15 @@ extension ComposeContentViewController { self.tableView.contentInset.bottom = padding - self.view.safeAreaInsets.bottom self.tableView.verticalScrollIndicatorInsets.bottom = padding - self.view.safeAreaInsets.bottom UIView.animate(withDuration: 0.3) { - self.composeContentToolbarViewBottomLayoutConstraint.constant = endFrame.height + // ref: https://developer.apple.com/documentation/uikit/uiresponder/1621578-keyboardframeenduserinfokey + let localKeyboardFrame = self.view.convert(endFrame, from: self.view.window!.screen.coordinateSpace) + let intersection = self.view.bounds.intersection(localKeyboardFrame) + if intersection.isEmpty { + self.composeContentToolbarViewBottomLayoutConstraint.constant = 0 + } else { + self.composeContentToolbarViewBottomLayoutConstraint.constant = self.view.bounds.maxY - intersection.minY + } + self.view.layoutIfNeeded() } })