mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Reset keyboard after message sent (#299)
This commit is contained in:
parent
05986cd785
commit
7a7680b165
@ -80,6 +80,7 @@ private struct UITextViewWrapper: UIViewRepresentable {
|
||||
textView.returnKeyType = .default
|
||||
textView.textContainer.lineFragmentPadding = 0.0
|
||||
textView.textContainerInset = .zero
|
||||
textView.keyboardType = .twitter
|
||||
|
||||
textView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||
|
||||
@ -89,6 +90,17 @@ private struct UITextViewWrapper: UIViewRepresentable {
|
||||
func updateUIView(_ textView: UITextView, context: UIViewRepresentableContext<UITextViewWrapper>) {
|
||||
if textView.text != text {
|
||||
textView.text = text
|
||||
|
||||
if text.isEmpty {
|
||||
// text cleared, probably because the written text is sent
|
||||
// reload keyboard type
|
||||
if textView.isFirstResponder {
|
||||
textView.keyboardType = .default
|
||||
textView.reloadInputViews()
|
||||
textView.keyboardType = .twitter
|
||||
textView.reloadInputViews()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UITextViewWrapper.recalculateHeight(view: textView, result: $calculatedHeight, maxHeight: maxHeight)
|
||||
|
1
changelog.d/269.bugfix
Normal file
1
changelog.d/269.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Timeline: Reset keyboard after a message is sent.
|
Loading…
x
Reference in New Issue
Block a user