Spaces:
Building
Building
Update flare-ui/src/app/dialogs/api-edit-dialog/api-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/api-edit-dialog/api-edit-dialog.component.ts
CHANGED
@@ -574,7 +574,7 @@ export default class ApiEditDialogComponent implements OnInit {
|
|
574 |
const variableText = `{{${variable}}}`;
|
575 |
const cursorPos = this.cursorPositions[field] || currentValue.length;
|
576 |
|
577 |
-
//
|
578 |
const newValue =
|
579 |
currentValue.slice(0, cursorPos) +
|
580 |
variableText +
|
@@ -582,9 +582,17 @@ export default class ApiEditDialogComponent implements OnInit {
|
|
582 |
|
583 |
control.setValue(newValue);
|
584 |
|
585 |
-
//
|
586 |
setTimeout(() => {
|
587 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
588 |
if (textarea) {
|
589 |
const newPos = cursorPos + variableText.length;
|
590 |
textarea.setSelectionRange(newPos, newPos);
|
|
|
574 |
const variableText = `{{${variable}}}`;
|
575 |
const cursorPos = this.cursorPositions[field] || currentValue.length;
|
576 |
|
577 |
+
// Değişkeni cursor pozisyonuna ekle
|
578 |
const newValue =
|
579 |
currentValue.slice(0, cursorPos) +
|
580 |
variableText +
|
|
|
582 |
|
583 |
control.setValue(newValue);
|
584 |
|
585 |
+
// Cursor pozisyonunu güncelle (değişken sonrası)
|
586 |
setTimeout(() => {
|
587 |
+
// ✅ Auth field'ları için özel selector
|
588 |
+
let selector = `textarea[formControlName="${field}"]`;
|
589 |
+
if (field === 'auth.token_request_body') {
|
590 |
+
selector = 'div[formGroupName="auth"] textarea[formControlName="token_request_body"]';
|
591 |
+
} else if (field === 'auth.token_refresh_body') {
|
592 |
+
selector = 'div[formGroupName="auth"] textarea[formControlName="token_refresh_body"]';
|
593 |
+
}
|
594 |
+
|
595 |
+
const textarea = document.querySelector(selector) as HTMLTextAreaElement;
|
596 |
if (textarea) {
|
597 |
const newPos = cursorPos + variableText.length;
|
598 |
textarea.setSelectionRange(newPos, newPos);
|