Skip to content

Commit da83e9c

Browse files
authored
Merge pull request #2252 from nextcloud/fix/noid/keyboard-issue-after-dismissing-modal
fix: Keyboard issue after dismissing modal view controller
2 parents ddd689e + b2d3a9a commit da83e9c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

NextcloudTalk/Chat/BaseChatViewController.swift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,6 +1923,11 @@ import SwiftUI
19231923
func transcribeVoiceMessage(with fileStatus: NCChatFileStatus) {
19241924
guard let fileLocalPath = fileStatus.fileLocalPath else { return }
19251925

1926+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
1927+
// may be incorrect after dismissing a modal/context menu on iOS 26.
1928+
// TODO: Recheck if this behavior is fixed on iOS 26+.
1929+
self.textView.resignFirstResponder()
1930+
19261931
DispatchQueue.main.async {
19271932
let audioFileURL = URL(fileURLWithPath: fileLocalPath)
19281933
let viewController = VoiceMessageTranscribeViewController(audiofileUrl: audioFileURL)
@@ -2773,6 +2778,11 @@ import SwiftUI
27732778
// Actuate `Peek` feedback (weak boom)
27742779
AudioServicesPlaySystemSound(1519)
27752780

2781+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
2782+
// may be incorrect after dismissing a modal/context menu on iOS 26.
2783+
// TODO: Recheck if this behavior is fixed on iOS 26+.
2784+
self.textView.resignFirstResponder()
2785+
27762786
let reactionsVC = ReactionsSummaryView(style: .insetGrouped)
27772787
reactionsVC.room = self.room
27782788
self.presentWithNavigation(reactionsVC, animated: true)
@@ -3228,6 +3238,9 @@ import SwiftUI
32283238
self.contextMenuMessageView?.layer.mask = nil
32293239
}
32303240

3241+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
3242+
// may be incorrect after dismissing a modal/context menu on iOS 26.
3243+
// TODO: Recheck if this behavior is fixed on iOS 26+.
32313244
self.textView.resignFirstResponder()
32323245
}
32333246

@@ -3606,6 +3619,11 @@ import SwiftUI
36063619
let mediaViewController = NCMediaViewerViewController(initialMessage: message, room: self.room)
36073620
let navController = CustomPresentableNavigationController(rootViewController: mediaViewController)
36083621

3622+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
3623+
// may be incorrect after dismissing a modal/context menu on iOS 26.
3624+
// TODO: Recheck if this behavior is fixed on iOS 26+.
3625+
self.textView.resignFirstResponder()
3626+
36093627
self.present(navController, interactiveDismissalType: .standard)
36103628

36113629
return
@@ -3620,6 +3638,11 @@ import SwiftUI
36203638
let mediaViewController = NCMediaViewerViewController(initialMessage: message, room: self.room)
36213639
let navController = CustomPresentableNavigationController(rootViewController: mediaViewController)
36223640

3641+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
3642+
// may be incorrect after dismissing a modal/context menu on iOS 26.
3643+
// TODO: Recheck if this behavior is fixed on iOS 26+.
3644+
self.textView.resignFirstResponder()
3645+
36233646
self.present(navController, interactiveDismissalType: .standard)
36243647
return
36253648
}
@@ -3720,6 +3743,11 @@ import SwiftUI
37203743
// MARK: - LocationMessageTableViewCell
37213744

37223745
public func cellWants(toOpenLocation geoLocationRichObject: GeoLocationRichObject) {
3746+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
3747+
// may be incorrect after dismissing a modal/context menu on iOS 26.
3748+
// TODO: Recheck if this behavior is fixed on iOS 26+.
3749+
self.textView.resignFirstResponder()
3750+
37233751
self.presentWithNavigation(MapViewController(geoLocationRichObject: geoLocationRichObject), animated: true)
37243752
}
37253753

@@ -3731,6 +3759,11 @@ import SwiftUI
37313759

37323760
guard let pollId = Int(poll.parameterId) else { return }
37333761

3762+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
3763+
// may be incorrect after dismissing a modal/context menu on iOS 26.
3764+
// TODO: Recheck if this behavior is fixed on iOS 26+.
3765+
self.textView.resignFirstResponder()
3766+
37343767
NCAPIController.sharedInstance().getPollWithId(pollId, inRoom: self.room.token, for: self.account) { poll, error, _ in
37353768
if error == nil, let poll {
37363769
pollVC.updatePoll(poll: poll)
@@ -3740,6 +3773,11 @@ import SwiftUI
37403773

37413774
// MARK: - Thread messages
37423775
public func cellWants(toShowThread message: NCChatMessage) {
3776+
// Hiding the keyboard due to a UIKit issue where the reported keyboard height
3777+
// may be incorrect after dismissing a modal/context menu on iOS 26.
3778+
// TODO: Recheck if this behavior is fixed on iOS 26+.
3779+
self.textView.resignFirstResponder()
3780+
37433781
self.didPressShowThread(for: message)
37443782
}
37453783

0 commit comments

Comments
 (0)