View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012015 | 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 | 0012015: Merchant: 'Create New Order' does not focus the amount | ||||
| Description | What happens: Orders -> create opens on 'Quick amount' with Amount prefilled '10.00'; nothing is focused (BODY). Expected: Focus the amount with the suggested value selected, so typing an amount replaces it. Where: - packages/taler-merchant-webui/src/screens/CreateOrderScreen.tsx:237 Measured in headless Chromium (document.activeElement): before: BODY after: INPUT#order-amount[number] with '10.00' selected Proposed fix: Form ref + mount effect: focus() and select() #order-amount (AmountInput's number field; absent in itemized mode, then nothing happens). 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 selection | ||||
| Tags | No tags attached. | ||||
| Attached Files | merchant-a--create-order.diff (1,604 bytes)
diff --git a/packages/taler-merchant-webui/src/screens/CreateOrderScreen.tsx b/packages/taler-merchant-webui/src/screens/CreateOrderScreen.tsx
index 16103a65a..3220b27eb 100644
--- a/packages/taler-merchant-webui/src/screens/CreateOrderScreen.tsx
+++ b/packages/taler-merchant-webui/src/screens/CreateOrderScreen.tsx
@@ -15,7 +15,7 @@
*/
import type { VNode } from "preact";
-import { useState } from "preact/hooks";
+import { useEffect, useRef, useState } from "preact/hooks";
import { useLocation } from "wouter-preact";
import { Header } from "../ui/Header.js";
import { FormActionFooter, useFormFeedback } from "../ui/FormActionFooter.js";
@@ -232,6 +232,15 @@ export function CreateOrderScreen({
"quick",
);
const [amountInput, setAmountInput] = useState<string>("10.00");
+ // An order starts with its amount. The suggested one is selected so that
+ // typing replaces it.
+ const form = useRef<HTMLFormElement>(null);
+ useEffect(() => {
+ const amount =
+ form.current?.querySelector<HTMLInputElement>("#order-amount");
+ amount?.focus();
+ amount?.select();
+ }, []);
const [itemizedOverrideEnabled, setItemizedOverrideEnabled] =
useState<boolean>(false);
const [itemizedOverrideAmount, setItemizedOverrideAmount] =
@@ -1235,7 +1244,7 @@ export function CreateOrderScreen({
</Header>
</div>
- <form onSubmit={handleSubmitOrder} class="space-y-6">
+ <form ref={form} onSubmit={handleSubmitOrder} class="space-y-6">
<>
<div
class="flex rounded-xl border border-gray-300 bg-gray-100 p-1"
| ||||
| 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-order.diff | |
| 2026-11-10 23:43 | bot-cg | File Added: merchant-a--create-order--before.png | |
| 2026-11-10 23:43 | bot-cg | File Added: merchant-a--create-order--after.png |