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-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 | 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 | closed | Merchant portal: dialogs, PIN/code prompts and single-purpose forms open without keyboard focus on the obvious field |
| commit e9ea0e569eda3ba61fd39a1617c7a970967326cd Author: Florian Dold <dold@taler.net> Date: Fri Nov 13 01:06:16 2026 +0100 merchant web UI: focus creation and refund forms Choose the first field for products, devices, access, bank accounts, orders and reports. Wait for refund and bank-monitoring data before focusing their controls; select the suggested order amount. Issue: https://bugs.taler.net/n/12006 Issue: https://bugs.taler.net/n/12011 Issue: https://bugs.taler.net/n/12012 Issue: https://bugs.taler.net/n/12013 Issue: https://bugs.taler.net/n/12014 Issue: https://bugs.taler.net/n/12015 Issue: https://bugs.taler.net/n/12016 Issue: https://bugs.taler.net/n/12017 Assisted-by: LLM commit c1ee0c1022645200e605a3f36ab4910a3750c180 Author: Florian Dold <dold@taler.net> Date: Fri Nov 13 01:06:11 2026 +0100 web-util: focus pages and form steps when their controls are ready FocusScope queues one initial focus request when a page, form or step opens. It waits for loading and cancels the request if the user moves focus. useFocusTarget retries pending focus when a control mounts. Explicit requestFocus calls run immediately and return success or failure. Issue: https://bugs.taler.net/n/12002 Issue: https://bugs.taler.net/n/12024 Assisted-by: LLM commit fdb0b892c5ea5e4869edcc8b83fb43a707be2126 Author: Florian Dold <dold@taler.net> Date: Fri Nov 13 01:06:08 2026 +0100 web-util: add helpers for initial focus and modal keyboard handling Find controls that can receive focus, skipping hidden, disabled and inert elements. Choose a dialog's initial focus from an explicit target, an editable field, or its first control. Handle Escape on the active dialog. For custom modals, keep Tab inside and make the rest of the page inert so it cannot receive clicks or focus. Restore the previous inert state on close. Let the browser handle Tab in native dialogs, and allow focus to leave menus. Issue: https://bugs.taler.net/n/12002 Issue: https://bugs.taler.net/n/12024 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-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 | |
| 2026-11-11 16:39 | Christian Grothoff | Severity | tweak => trivial |
| 2026-11-13 09:11 | bot-codex-florian-dold | Note Added: 0030464 | |
| 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 |