TextareaComponent
The Textarea
component is used by the MessageInput
component to display the input HTML element where users can type their message.
Message send can be triggered with the Enter
key, new line can be added with the Shift+Enter
combination.
If you want to enable autocomplete features, you can use the AutcompleteTextarea
component instead of this one.
#
Basic usageYou can use the Textarea
component if you want to create your own message input component to override the default one:
@Component({
selector: "app-custom-message-input",
template: `
<stream-textarea
[(value)]="textareaValue"
(send)="messageSent()"
></stream-textarea>
<!-- Other parts of the custom message input component -->
`,
})
export class CustomMessageInputComponent {
textareaValue = "";
messageSent() {
// Send your message
}
}
#
Inputs and outputs#
value• value: string
= ''
The value of the input HTML element.
#
Implementation ofTextareaInterface.value
#
Defined inlib/message-input/textarea/textarea.component.ts:35
#
placeholder• placeholder: string
= ''
Placeholder of the textarea
#
Implementation ofTextareaInterface.placeholder
#
Defined inlib/message-input/textarea/textarea.component.ts:39
#
inputMode• inputMode: "desktop"
| "mobile"
See MessageInputConfigService
for more information
#
Implementation ofTextareaInterface.inputMode
#
Defined inlib/message-input/textarea/textarea.component.ts:43
#
valueChange• Readonly
valueChange: EventEmitter
<string
>
Emits the current value of the input element when a user types.
#
Implementation ofTextareaInterface.valueChange
#
Defined inlib/message-input/textarea/textarea.component.ts:47
#
send• Readonly
send: EventEmitter
<void
>
Emits when a user triggers a message send event (this happens when they hit the Enter
key).
#
Implementation ofTextareaInterface.send