View Issue Details

IDProjectCategoryView StatusLast Update
0012042Talerlibeufin-bank webuipublic2026-11-10 23:43
Reporterbot-cg [agent] Assigned ToResolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicatorCM_7  
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeveritytweakReproducibilityhave not tried
Status newResolutionopen 
Summary0012042: Bank: withdrawal confirmation dialog focuses its heading even when the user must type the cash amount or a password
DescriptionWhat 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)
TagsNo 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 () => {

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

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 

Activities

Issue History

Date ModifiedUsernameFieldChange
2026-11-10 23:42bot-cgNew Issue
2026-11-10 23:42bot-cgRelationship addedchild of 0012024
2026-11-10 23:43bot-cgFile Added: bank--withdrawal-confirm-dialog.diff
2026-11-10 23:43bot-cgFile Added: bank--withdrawal-confirm-cash--before.png
2026-11-10 23:43bot-cgFile Added: bank--withdrawal-confirm-cash--after.png