View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012020 | Taler | merchant portal webui | public | 2026-11-10 23:41 | 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 | 0012020: Merchant: Remove bank account confirmation does not take focus (and Escape does nothing) | ||||
| Description | What happens: Bank accounts & payouts -> account '⋯' menu -> 'Delete' shows a hand-made role=dialog overlay. The menu (and the item that had focus) unmounts, so focus falls to BODY; the dialog's onKeyDown Escape handler therefore never fires (measured: still open after Escape). Expected: Focus starts inside the confirmation on Cancel, not on 'Yes, remove it'. Where: - packages/taler-merchant-webui/src/screens/MoneyInScreen.tsx:197 - packages/taler-merchant-webui/src/screens/MoneyInScreen.tsx:1339 Measured in headless Chromium (document.activeElement): before: BODY; Escape: dialog stays open after: BUTTON 'Cancel' inside the dialog; Escape closes it Proposed fix: Ref on the Cancel button and an effect on deletingAccount that focuses it when the dialog opens; Escape now works through the existing handler. 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 for file; screens.test.js passes; screenshot confirms | ||||
| Tags | No tags attached. | ||||
| Attached Files | merchant-b--money-in-remove-account-dialog.diff (1,637 bytes)
diff --git a/packages/taler-merchant-webui/src/screens/MoneyInScreen.tsx b/packages/taler-merchant-webui/src/screens/MoneyInScreen.tsx
index 727eb01a9..7bc2439a9 100644
--- a/packages/taler-merchant-webui/src/screens/MoneyInScreen.tsx
+++ b/packages/taler-merchant-webui/src/screens/MoneyInScreen.tsx
@@ -15,7 +15,7 @@
*/
import type { VNode } from "preact";
-import { useState } from "preact/hooks";
+import { useEffect, useRef, useState } from "preact/hooks";
import { TalerMerchantApi } from "@gnu-taler/taler-util";
import { BankMonitoringDialog } from "./BankMonitoringDialog.js";
import { Header } from "../ui/Header.js";
@@ -191,6 +191,13 @@ export function MoneyInScreen({
>(undefined);
const [isDeletingAccount, setIsDeletingAccount] = useState<boolean>(false);
const [deleteAccountError, setDeleteAccountError] = useState<unknown>();
+ // Open the confirmation on its safe choice. The dialog only hears Escape
+ // while focus is inside it, and the account menu that opens it unmounts the
+ // control that had focus.
+ const deleteAccountCancel = useRef<HTMLButtonElement>(null);
+ useEffect(() => {
+ if (deletingAccount) deleteAccountCancel.current?.focus();
+ }, [deletingAccount]);
const [openAccountMenuId, setOpenAccountMenuId] = useState<
string | undefined
>(undefined);
@@ -1329,6 +1336,7 @@ export function MoneyInScreen({
/>
<div class="flex justify-end space-x-2 pt-2">
<button
+ ref={deleteAccountCancel}
type="button"
onClick={() => {
setDeletingAccount(undefined);
| ||||
| child of | 0012002 | closed | Merchant portal: dialogs, PIN/code prompts and single-purpose forms open without keyboard focus on the obvious field |
| commit 073d2e7f48bb3ba51738e900ae533a2e0dc80876 Author: Florian Dold <dold@taler.net> Date: Fri Nov 13 01:06:16 2026 +0100 merchant web UI: use shared focus handling for custom dialogs Move pairing, account removal, order deletion and template overlays to Modal. Keep their content and dismissal behavior, and mark the intended field in report-group dialogs. Issue: https://bugs.taler.net/n/12005 Issue: https://bugs.taler.net/n/12018 Issue: https://bugs.taler.net/n/12019 Issue: https://bugs.taler.net/n/12020 Issue: https://bugs.taler.net/n/12021 Assisted-by: LLM commit c58cf2ae54417fe5d5cab9075ff3d88e52f3796b Author: Florian Dold <dold@taler.net> Date: Fri Nov 13 01:06:16 2026 +0100 merchant web UI: share dialog and menu focus handling Let Modal choose its initial target and use DialogFocusScope for Tab, Escape and restoration. Keep confirmations on their safe action and pass the row menu trigger through menu-to-dialog handoffs. Issue: https://bugs.taler.net/n/12004 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:41 | bot-cg | New Issue | |
| 2026-11-10 23:41 | bot-cg | Relationship added | child of 0012002 |
| 2026-11-10 23:43 | bot-cg | File Added: merchant-b--money-in-remove-account-dialog.diff | |
| 2026-11-10 23:43 | bot-cg | File Added: merchant-b--money-in-remove-account-dialog--before.png | |
| 2026-11-10 23:43 | bot-cg | File Added: merchant-b--money-in-remove-account-dialog--after.png | |
| 2026-11-11 08:25 | Christian Grothoff | Severity | minor => trivial |
| 2026-11-13 09:11 | bot-codex-florian-dold | Note Added: 0030469 | |
| 2026-11-13 09:12 | bot-codex-florian-dold | Status | new => closed |
| 2026-11-13 09:12 | bot-codex-florian-dold | Resolution | open => fixed |
| 2026-11-18 17:03 | Christian Grothoff | Target Version | => 1.6 |
| 2026-11-18 17:07 | Christian Grothoff | Fixed in Version | => 1.6 |