View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012042 | Taler | libeufin-bank webui | public | 2026-11-10 23:42 | 2026-11-10 23:43 |
| Reporter | bot-cg [agent] | Assigned To | Resolution deadline | ||
| Implementer | Reviewer | ||||
| Release signed by | Deployed by | ||||
| Verifier | Communicator | CM_7 | |||
| Data protection authority notification required | No | ||||
| CSIRT notification required | No | ||||
| Estimated effort (hours) | Actual effort (hours) | 0 | |||
| Fast-track | No | ||||
| Work package | none | ||||
| Priority | normal | Severity | tweak | Reproducibility | have not tried |
| Status | new | Resolution | open | ||
| Summary | 0012042: Bank: withdrawal confirmation dialog focuses its heading even when the user must type the cash amount or a password | ||||
| Description | What happens: NeedConfirmationView opens a modal <dialog> with showModal() and then always focuses the title <h2 tabIndex=-1>. Two variants have exactly one thing to type. (1) Cash-acceptor 'Enter accepted cash amount' has an empty amount input. (2) 'Sign in to confirm the withdrawal', shown when the withdrawal belongs to an account that is not signed in, embeds LoginForm with a fixed username, so the password is the only field. LoginForm's own mount focus runs in a child effect before the parent's effect calls showModal(), so it fails, and the title focus then wins. Measured activeElement: H2#withdrawal-confirmation-title in both. Expected: Focus the amount input (cash acceptor) or the password input (sign-in). Keep focusing the title in the plain 'Confirm wallet withdrawal' variant, which has no input. Where: - packages/libeufin-bank-webui/src/pages/OperationState/views.tsx:178 Measured in headless Chromium (document.activeElement): before: H2#withdrawal-confirmation-title (cash acceptor and sign-in variants) after: INPUT#amount (cash acceptor); INPUT#password (sign-in); fixed-amount variant unchanged: H2 title Proposed fix: After showModal(), focus the first editable input in the dialog (`input:not([readonly]):not([disabled])`) and fall back to the title. The readonly username is skipped. The fixed-amount variant has no input and still gets the title. Patch against taler-typescript-core master attached; the same change is committed on branch dev/bots/autofocus (durian). Screenshots attached (focused element outlined in red): 'before' is master, 'after' is with the patch. Verified: tsc ok; unit tests 94/94 (OperationState tests included); Chromium screenshots of all three variants (shots/bank--withdrawal-confirm-signin--{before,after}.png, shots/bank--withdrawal-confirm-fixed--{before,after}.png) | ||||
| Tags | No tags attached. | ||||
| Attached Files | bank--withdrawal-confirm-dialog.diff (925 bytes)
diff --git a/packages/libeufin-bank-webui/src/pages/OperationState/views.tsx b/packages/libeufin-bank-webui/src/pages/OperationState/views.tsx
index 5009adc5a..641986ff4 100644
--- a/packages/libeufin-bank-webui/src/pages/OperationState/views.tsx
+++ b/packages/libeufin-bank-webui/src/pages/OperationState/views.tsx
@@ -175,7 +175,13 @@ export function NeedConfirmationView({
return;
}
if (!dialog.open) dialog.showModal();
- titleRef.current?.focus();
+ // Start in the field the user has to fill when there is one: the cash
+ // amount, or the password when signing in first (the sign-in form's
+ // own focus ran before the dialog was shown). Otherwise the title.
+ const field = dialog.querySelector<HTMLInputElement>(
+ "input:not([readonly]):not([disabled])",
+ );
+ (field ?? titleRef.current)?.focus();
};
openDialog();
return () => {
| ||||
| child of | 0012024 | new | Web UIs (bank, wallet, exchange AML/KYC, challenger, auditor, web-util forms): dialogs and single-purpose forms open without keyboard focus on the obvious field |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-10 23:42 | bot-cg | New Issue | |
| 2026-11-10 23:42 | bot-cg | Relationship added | child of 0012024 |
| 2026-11-10 23:43 | bot-cg | File Added: bank--withdrawal-confirm-dialog.diff | |
| 2026-11-10 23:43 | bot-cg | File Added: bank--withdrawal-confirm-cash--before.png | |
| 2026-11-10 23:43 | bot-cg | File Added: bank--withdrawal-confirm-cash--after.png |