set ChatInputBar.inputText, the text is moved up
- Dominant language
- Swift
- Stars
- 4.6k
- Forks
- 588
- PR merge metrics
- No merged PRs in 30d
Description
I want to use return key to send message, but the text is moved up when setting inputText to anything text
```swift
extension DemoChatViewController: ChatInputBarDelegate {
func inputBarShouldBeginTextEditing(inputBar: ChattoAdditions.ChatInputBar) -> Bool {
return true
}
func inputBarDidBeginEditing(inputBar: ChattoAdditions.ChatInputBar) {
}
func inputBarDidEndEditing(inputBar: ChattoAdditions.ChatInputBar) {
}
func inputBarDidChangeText(inputBar: ChattoAdditions.ChatInputBar) {
if inputBar.inputText.containsString("\n") {
inputBar.inputText = "aaaa"
}
}
func inputBarSendButtonPressed(inputBar: ChattoAdditions.ChatInputBar) {
}
func inputBar(inputBar: ChattoAdditions.ChatInputBar, shouldFocusOnItem item: ChatInputItemProtocol) -> Bool {
return true
}
func inputBar(inputBar: ChattoAdditions.ChatInputBar, didReceiveFocusOnItem item: ChatInputItemProtocol) {
}
}
```
**before**

**after**

Contributor guide
Research direction
Start with the ChatInputBarDelegate inputBarDidChangeText example and reproduce the issue by assigning inputBar.inputText after a return key is entered. Trace how ChatInputBar updates its text layout and verify that assigning inputText no longer moves the text upward while preserving the shown return-key behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100