@@ -192,20 +192,19 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
192
192
}
193
193
}
194
194
. overlay (
195
- viewModel. showCommandsOverlay ?
196
- factory. makeCommandsContainerView (
197
- suggestions: viewModel. suggestions,
198
- handleCommand: { commandInfo in
199
- viewModel. handleCommand (
200
- for: $viewModel. text,
201
- selectedRangeLocation: $viewModel. selectedRangeLocation,
202
- command: $viewModel. composerCommand,
203
- extraData: commandInfo
204
- )
205
- }
206
- )
207
- . offset ( y: - composerHeight)
208
- . animation ( nil ) : nil ,
195
+ factory. makeCommandsContainerView (
196
+ suggestions: suggestions,
197
+ handleCommand: { commandInfo in
198
+ viewModel. handleCommand (
199
+ for: $viewModel. text,
200
+ selectedRangeLocation: $viewModel. selectedRangeLocation,
201
+ command: $viewModel. composerCommand,
202
+ extraData: commandInfo
203
+ )
204
+ }
205
+ )
206
+ . offset ( y: - composerHeight)
207
+ . animation ( nil ) ,
209
208
alignment: . bottom
210
209
)
211
210
. modifier ( factory. makeComposerViewModifier ( ) )
@@ -224,6 +223,14 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
224
223
} )
225
224
. accessibilityElement ( children: . contain)
226
225
}
226
+
227
+ var suggestions : [ String : Any ] {
228
+ var suggestions = viewModel. suggestions
229
+ if !viewModel. showCommandsOverlay {
230
+ suggestions. removeValue ( forKey: " instantCommands " )
231
+ }
232
+ return suggestions
233
+ }
227
234
}
228
235
229
236
/// View for the composer's input (text and media).
0 commit comments