I am working with an Angular form that has a textarea
<textarea class="form-control"
id="message"
formControlName="message"
(focus)="onFocusEvent($event)"
></textarea>
and a button that adds text to the end of it
<button (click)=addText()></button>
addText() {
const customText: string = 'customText';
this.form.setValue({message: this.form.get('message').value + '\n' + customText});
}
I am trying to figure out how to add the customText at the specific position where the mouse is currently located. Could I potentially use the onFocus event for this?