MessageInputConfigService
The MessageInputConfigService
is used to keep a consistent configuration among the different MessageInput
components if your UI has more than one input component.
Properties
areMentionsEnabled
areMentionsEnabled: undefined
| boolean
= true
If true, users can mention other users in messages. You also need to use the AutocompleteTextarea
for this feature to work.
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:20
customAutocompletes$
customAutocompletes$: BehaviorSubject
<CustomAutocomplete
[]>
Add custom autocomplete configurations to the message input
Only works when using StreamAutocompleteTextareaModule
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:57
customPasteEventHandler
Optional
customPasteEventHandler: (event
: ClipboardEvent
, inputComponent
: MessageInputComponent
) => void
Override the message input’s default event handler for paste events
The event handler will receive the event object, and the message input component.
You can use the public API of the message input component to update the composer. Typically you want to update the message text and/or attachments, this is how you can do these:
- Change message text:
inputComponent.textareaValue = '<new value>'
- Upload file or image attachments:
inputComponent.attachmentService.filesSelected(<files>)
- Upload custom attachments:
inputComponent.attachmentService.customAttachments$.next(<custom attachments>)
Type declaration
(event
, inputComponent
): void
Parameters
Name | Type |
---|---|
event | ClipboardEvent |
inputComponent | MessageInputComponent |
Returns
void
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:48
inputMode
inputMode: "mobile"
| "desktop"
= 'desktop'
In desktop
mode the Enter
key will trigger message sending, in mobile
mode the Enter
key will insert a new line to the message input.
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:32
isFileUploadEnabled
isFileUploadEnabled: undefined
| boolean
= true
If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary channel capability.
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:16
isMultipleFileUploadEnabled
isMultipleFileUploadEnabled: undefined
| boolean
= true
If false
, users can only upload one attachment per message
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:24
mentionScope
mentionScope: undefined
| "channel"
| "application"
= 'channel'
The scope for user mentions, either members of the current channel of members of the application
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:28
sendVoiceRecordingImmediately
sendVoiceRecordingImmediately: boolean
= true
If true
the recording will be sent as a message immediately after the recording is completed.
If false
, the recording will added to the attachment preview, and users can continue composing the message.
Defined in
projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts:37