Skip to content

Commit 0258f4d

Browse files
authored
Fix keyboard showing with attachment picker when editing a message (#965)
* Fix keyboard showing with attachment picker when editing a message * Update CHANGELOG.md
1 parent a52ff7b commit 0258f4d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
- Fix replacing an image while editing a message not showing the new image in the message list [#956](https://github.com/GetStream/stream-chat-swiftui/pull/956)
1414
- Improve precision when scrolling to the newest message with long text [#958](https://github.com/GetStream/stream-chat-swiftui/pull/958)
1515
- Fix draft attachments being sent with local file urls to the server [#964](https://github.com/GetStream/stream-chat-swiftui/pull/964)
16+
- Fix keyboard showing with attachment picker when editing a message [#965](https://github.com/GetStream/stream-chat-swiftui/pull/965)
1617
- Fix race condition when clearing text in a regular TextField [#955](https://github.com/GetStream/stream-chat-swiftui/pull/955)
1718
### 🔄 Changed
1819
- Change the gallery header view to show the message timestamp instead of online status [#962](https://github.com/GetStream/stream-chat-swiftui/pull/962)

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
181181
withAnimation(.easeInOut(duration: 0.02)) {
182182
viewModel.pickerTypeState = .expanded(.none)
183183
}
184+
} else if editedMessageWillShow {
185+
// When editing a message, the keyboard will show.
186+
// If the attachment picker is open, we should dismiss it.
187+
viewModel.pickerTypeState = .expanded(.none)
184188
}
185189
}
186190
keyboardShown = visible

0 commit comments

Comments
 (0)