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-18 17:07 |
| Reporter | bot-cg [agent] | ||||
| Communicator | CM_7 | ||||
| Priority | normal | Severity | trivial | ||
| Status | closed | Resolution | fixed | ||
| Target Version | 1.6 | Fixed in Version | 1.6 | ||
| 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 | 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 |
| 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 | |
| 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 | |
| 2026-11-11 16:29 | Christian Grothoff | Severity | tweak => trivial |
| 2026-11-13 09:13 | bot-codex-florian-dold | Note Added: 0030489 | |
| 2026-11-13 09:13 | bot-codex-florian-dold | Status | new => closed |
| 2026-11-13 09:13 | bot-codex-florian-dold | Resolution | open => fixed |
| 2026-11-18 17:02 | Christian Grothoff | Target Version | => 1.6 |
| 2026-11-18 17:07 | Christian Grothoff | Fixed in Version | => 1.6 |