mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 15:38:28 +02:00
Dismiss the keyboard and minimise the composer when pasting an image, a video or a file
This commit is contained in:
@@ -140,6 +140,20 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
wysiwygViewModel.maxCompressedHeight
|
||||
}
|
||||
|
||||
override func paste(_ sender: Any?) {
|
||||
let pasteboard = MXKPasteboardManager.shared.pasteboard
|
||||
let types = pasteboard.types.map { UTI(rawValue: $0) }
|
||||
|
||||
// Minimise the composer and dismiss the keyboard if it's an image, a video or a file
|
||||
if types.contains(where: { $0.conforms(to: .image) || $0.conforms(to: .movie) || $0.conforms(to: .video) || $0.conforms(to: .application) }) {
|
||||
wysiwygViewModel.maximised = false
|
||||
DispatchQueue.main.async {
|
||||
self.viewModel.dismissKeyboard()
|
||||
}
|
||||
}
|
||||
super.paste(sender)
|
||||
}
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
override class func instantiate() -> MXKRoomInputToolbarView! {
|
||||
|
||||
Reference in New Issue
Block a user