Various improvements

This commit is contained in:
Ali
2023-09-15 15:42:08 +02:00
parent 2028561610
commit 3b11fa400e
37 changed files with 1386 additions and 741 deletions

View File

@@ -901,21 +901,30 @@ public final class TextFieldComponent: Component {
if self.textView.inputView == nil {
self.textView.inputView = inputView
if self.textView.isFirstResponder {
self.textView.reloadInputViews()
// Avoid layout cycle
DispatchQueue.main.async { [weak self] in
self?.textView.reloadInputViews()
}
}
}
} else if component.hideKeyboard {
if self.textView.inputView == nil {
self.textView.inputView = EmptyInputView()
if self.textView.isFirstResponder {
self.textView.reloadInputViews()
// Avoid layout cycle
DispatchQueue.main.async { [weak self] in
self?.textView.reloadInputViews()
}
}
}
} else {
if self.textView.inputView != nil {
self.textView.inputView = nil
if self.textView.isFirstResponder {
self.textView.reloadInputViews()
// Avoid layout cycle
DispatchQueue.main.async { [weak self] in
self?.textView.reloadInputViews()
}
}
}
}