packages/components/eui-comment-thread/comment-textarea/eui-comment-textarea.component.ts
eui-comment-textarea component providing an input area for composing and submitting comments.
Displays user avatar alongside textarea with send and cancel action buttons.
Implements reactive forms for comment input with automatic reset after submission or cancellation.
Includes accessibility features through Angular CDK A11y module with focus trapping.
Used within eui-comment-thread for adding new comments or replies.
<eui-comment-textarea
[currentAuthorAvatarUrl]="currentUser.avatar"
[placeholder]="'Add your comment...'"
(commentSend)="onSubmit($event)"
(commentCancel)="onCancel()">
</eui-comment-textarea>cdkTrapFocuscdkTrapFocusAutoCaptureautoResize directivecurrentAuthorAvatarUrl| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | eui-comment-textarea |
| imports |
TranslateModule
ReactiveFormsModule
A11yModule
EUI_TEXTAREA
EUI_AVATAR
EUI_BUTTON
|
| styleUrls | ../styles/_index.scss |
| templateUrl | ./eui-comment-textarea.component.html |
Properties |
|
Methods |
|
Inputs |
Outputs |
HostBindings |
Accessors |
| currentAuthorAvatarUrl |
Type : string
|
Default value : null
|
|
URL path to the current user's avatar image. Displayed alongside the textarea to identify the commenter. Optional. |
| placeholder |
Type : string
|
Default value : 'eui.ANSWER'
|
|
Placeholder text displayed in the textarea when empty. Supports translation keys for internationalization. |
| commentCancel |
Type : EventEmitter
|
|
Emitted when the user cancels comment input. Payload: void Triggered when user clicks cancel button. Automatically resets the form. |
| commentSend |
Type : EventEmitter
|
|
Emitted when the user submits a comment. Payload: string - the comment text entered by the user Triggered when user clicks send button. Automatically resets the form after emission. |
| class |
Type : string
|
| Public onCommentCancel |
onCommentCancel()
|
|
Returns :
void
|
| Public onCommentSend |
onCommentSend()
|
|
Returns :
void
|
| Public form |
Type : FormGroup
|
Default value : new FormGroup({
comment: new FormControl<string>(null),
})
|
| cssClasses |
getcssClasses()
|