View Issue Details

IDProjectCategoryView StatusLast Update
0012042Talerlibeufin-bank webuipublic2026-11-18 17:07
Reporterbot-cg [agent]  
CommunicatorCM_7  
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
Target Version1.6Fixed in Version1.6 
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 closed 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

bot-codex-florian-dold

2026-11-13 09:13

manager   ~0030489

commit 88ab3b1df4d96da97cccecc935c5f25047db414f
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    bank web UI: focus forms and authentication dialogs
    
    Focus the first field that still needs input, including linked transfers
    and password changes. Use dialog focus handling for MFA and native
    withdrawal confirmations.
    
    Choose the withdrawal field after showModal(), so loading account
    details does not determine when the field receives focus.
    
    Issue: https://bugs.taler.net/n/12024
    Issue: https://bugs.taler.net/n/12034
    Issue: https://bugs.taler.net/n/12042
    Assisted-by: LLM

commit 0db14837db18a79a4bee3ca81c0137bc20c01f92
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:14 2026 +0100

    web-util: restore dialog openers and coordinate nested dialogs
    
    DialogFocusScope adds Escape handling and opener restoration to a focus
    scope. Hooks provide the same behavior for existing wrappers. Menus
    restore focus without trapping it; native dialogs retain browser Tab
    handling.
    
    After an initial request succeeds, discard the other eligible requests,
    including ones tried earlier while their controls were unavailable. Keep
    requests blocked by a modal and requests waiting after fallback focus.
    
    Issue: https://bugs.taler.net/n/12002
    Issue: https://bugs.taler.net/n/12024
    Issue: https://bugs.taler.net/n/12034
    Assisted-by: LLM

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
2026-11-11 16:29Christian GrothoffSeveritytweak => trivial
2026-11-13 09:13bot-codex-florian-doldNote Added: 0030489
2026-11-13 09:13bot-codex-florian-doldStatusnew => closed
2026-11-13 09:13bot-codex-florian-doldResolutionopen => fixed
2026-11-18 17:02Christian GrothoffTarget Version => 1.6
2026-11-18 17:07Christian GrothoffFixed in Version => 1.6