fix: Cursor-Problem beim Frage-ID Editieren
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s

Problem: Cursor springt nach jedem Tastendruck aus dem ID-Feld

Ursache: key={q.id} in QuestionEditor map
- Wenn ID geändert wird, ändert sich der React Key
- React unmountet alte Component und mountet neue
- Focus geht verloren

Lösung: key={idx} verwenden
- Stabiler Key während Editing
- Komponente bleibt gemountet
- Cursor bleibt im Feld

UX: Jetzt kann man IDs flüssig editieren ohne Unterbrechung

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-04-12 12:29:52 +02:00
parent 08c9cccdcc
commit 77f1ed14c5

View File

@ -47,7 +47,7 @@ export function QuestionAugmentationPanel({ node, onChange }) {
{questions.map((q, idx) => ( {questions.map((q, idx) => (
<QuestionEditor <QuestionEditor
key={q.id} key={idx}
question={q} question={q}
index={idx} index={idx}
onChange={(field, value) => handleQuestionChange(idx, field, value)} onChange={(field, value) => handleQuestionChange(idx, field, value)}