Bug — Einkaufsliste-Mengen-Dialog markiert bestehenden Text nicht beim Öffnen #176
Labels
No labels
priority/could
priority/must
priority/should
priority/wont
status/blocked
status/claimed
status/done-migrated
type/bug
type/feature
type/infra
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
robert/todo#176
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Story: Bug — Einkaufsliste-Mengen-Dialog markiert bestehenden Text nicht beim Öffnen
As a Nutzer, der die Menge eines bereits eingetragenen Produkts ändert,
I want to dass der bestehende Wert beim Öffnen des Dialogs komplett markiert ist,
so that ich sofort lostippen kann, ohne erst manuell zu markieren oder zu löschen.
Kontext (verifiziert im Code):
ShoppingProductQuantityDialog.tsx: Das<Input>-Feld für die Menge nutzt nurautoFocus(Zeile ~94), keine Selektion des vorbelegten Werts (setQuantity(product?.quantity ?? '')bei Zeile 32). Der Cursor landet dadurch hinter dem bestehenden Text, neue Eingaben hängen sich an statt ihn zu ersetzen.Acceptance criteria:
onFocus={e => e.target.select()}oder einem entsprechendenuseEffect).Out of scope for this story:
Claiming this for the current go-loop cycle. Plan: select the existing value in ShoppingProductQuantityDialog.tsx quantity input on open (e.g. onFocus select, alongside the existing autoFocus), so typing immediately replaces it instead of appending. No backend changes needed.
Done. Added
onFocus={e => e.target.select()}to the quantity<Input>inShoppingProductQuantityDialog.tsx, alongside the existingautoFocus. Opening the dialog for an already-entered product now selects the full existing value, so typing immediately replaces it instead of appending after the cursor. Empty-field behavior is unaffected (selecting an empty string is a no-op).Tests: added a regression test asserting
selectionStart/selectionEndspan the full pre-filled value on focus. Full frontend suite (1211 tests) green locally,npm run buildclean. No backend changes.Commit:
8211fcf3.