View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012013 | Taler | merchant portal webui | public | 2026-11-10 23:41 | 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 | 0012013: Merchant: 'Add offline payment device' does not focus Name | ||||
| Description | What happens: Offline payment devices -> add opens the form; focus is on BODY. Expected: In create mode focus Name (the ID is derived from it); edit mode unchanged. Where: - packages/taler-merchant-webui/src/screens/CreateDeviceScreen.tsx:198 Measured in headless Chromium (document.activeElement): before: BODY after: INPUT#auth_name Proposed fix: Ref on #auth_name focused on mount when not editing. 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; eslint clean; screenshot confirms | ||||
| Tags | No tags attached. | ||||
| Attached Files | merchant-a--create-device.diff (1,477 bytes)
diff --git a/packages/taler-merchant-webui/src/screens/CreateDeviceScreen.tsx b/packages/taler-merchant-webui/src/screens/CreateDeviceScreen.tsx
index c96f09aad..5b4672124 100644
--- a/packages/taler-merchant-webui/src/screens/CreateDeviceScreen.tsx
+++ b/packages/taler-merchant-webui/src/screens/CreateDeviceScreen.tsx
@@ -16,7 +16,7 @@
import type { VNode } from "preact";
import { currentBackendUrl, session } from "../stores/session.js";
-import { useRef, useState } from "preact/hooks";
+import { useEffect, useRef, useState } from "preact/hooks";
import { useLocation } from "wouter-preact";
import {
DeviceSetupScreen,
@@ -193,6 +193,12 @@ function CreateDeviceForm({
.replace(/^_+|_+$/g, "");
const [name, setName] = useState<string>(existingDevice?.name || "");
+ // A new device starts with its name. When editing, no field in particular
+ // comes first.
+ const nameInput = useRef<HTMLInputElement>(null);
+ useEffect(() => {
+ if (!editingId) nameInput.current?.focus();
+ }, [editingId]);
const [deviceId, setDeviceId] = useState<string>(existingDevice?.id || "");
const [manualId, setManualId] = useState<boolean>(
Boolean(existingDevice?.id),
@@ -330,6 +336,7 @@ function CreateDeviceForm({
{t`Name`} <span class="text-red-500">*</span>
</label>
<input
+ ref={nameInput}
id="auth_name"
type="text"
required
| ||||
| child of | 0012002 | new | Merchant portal: dialogs, PIN/code prompts and single-purpose forms open without keyboard focus on the obvious field |
| 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-a--create-device.diff | |
| 2026-11-10 23:43 | bot-cg | File Added: merchant-a--create-device--before.png | |
| 2026-11-10 23:43 | bot-cg | File Added: merchant-a--create-device--after.png |