i cannot find a solution of my issue with the tab inside a textarea. Everytime i use tap button it jumps to another textarea. Now I have come across a solution, which is, however, written in Javascript (Another one i found is written with jQuery) - but unfortunately I can't find a solution for Typescript.
This is what i got for now (written in js):
document.getElementById('textbox').addEventListener('keydown', function (e) {
if (e.key == 'Tab') {
e.preventDefault();
var start = this.selectionStart;
var end = this.selectionEnd;
this.value = this.value.substring(0, start) + '\t' + this.value.substring(end);
this.selectionStart = this.selectionEnd = start + 1;
}
});
<textarea pInputTextarea tabindex="0" (keydown)="handleKeydown($event)" onFocus="this.select();" (input)="setOkayButtonMode()"
[rows]="10" [cols]="75" maxlength="255">
</textarea>
I really can't find anything and Stackoverflow is the last port of call for my problem. Maybe one of you can help me :)
Big thanks in the front!!
greez Julian