View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012056 | Taler | wallet (WebExtension) | public | 2026-11-10 23:42 | 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 | 0012056: Wallet demo: 'Scenarios' menu opens without moving focus into the menu | ||||
| Description | What happens: Demo build header 'Scenarios ▾' (role=menu). Same pattern as the overflow menu: focus stays on the trigger. activeElement: BUTTON 'Scenarios ▾'. Expected: First scenario focused on open; focus back on the trigger after Escape or a choice. Where: - packages/wallet-webui/src/ui/DemoBanner.tsx:15 Measured in headless Chromium (document.activeElement): before: BUTTON 'Scenarios ▾' after: BUTTON role=menuitem 'Sample payment' Proposed fix: Same as overflow-menu: focus first menuitem on open, return focus to the trigger on Escape/selection. 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 (0 errors in wallet-webui with workspace sources; plain `tsc --noEmit -p .` output identical to baseline, whose errors come from stale taler-util/wallet-core lib/); eslint + prettier clean on changed files; package tests screens/exchange-removal/payment-entry/routing bundled from src: 89/95 pass, the same 6 App-level demo tests fail before and after; screenshots in the demo build. | ||||
| Tags | No tags attached. | ||||
| Attached Files | wallet--demo-scenarios-menu.diff (1,884 bytes)
diff --git a/packages/wallet-webui/src/ui/DemoBanner.tsx b/packages/wallet-webui/src/ui/DemoBanner.tsx
index 4b0c92ac1..9018e4394 100644
--- a/packages/wallet-webui/src/ui/DemoBanner.tsx
+++ b/packages/wallet-webui/src/ui/DemoBanner.tsx
@@ -12,11 +12,18 @@ export function DemoBanner(props: {
const [open, setOpen] = useState(false);
const [confirmReset, setConfirmReset] = useState(false);
const menuRef = useRef<HTMLDivElement>(null);
+ const triggerRef = useRef<HTMLButtonElement>(null);
useEffect(() => {
if (!open) return;
+ // Move into the menu when it opens and back to its button when it closes
+ // from the keyboard or a choice, so focus is not lost with the items.
+ menuRef.current?.querySelector<HTMLElement>('[role="menuitem"]')?.focus();
const close = (event: KeyboardEvent) => {
- if (event.key === "Escape") setOpen(false);
+ if (event.key !== "Escape") return;
+ if (menuRef.current?.contains(document.activeElement))
+ triggerRef.current?.focus();
+ setOpen(false);
};
const outside = (event: PointerEvent) => {
if (!menuRef.current?.contains(event.target as Node)) setOpen(false);
@@ -56,6 +63,7 @@ export function DemoBanner(props: {
)}
<div class="relative" ref={menuRef}>
<button
+ ref={triggerRef}
type="button"
aria-expanded={open}
aria-haspopup="menu"
@@ -79,6 +87,7 @@ export function DemoBanner(props: {
role="menuitem"
onClick={() => {
setOpen(false);
+ triggerRef.current?.focus();
props.onScenario(scenario.id);
}}
class="block w-full rounded-lg px-3 py-2 text-left font-medium hover:bg-secondaryContainer focus:outline-none focus:ring-2 focus:ring-primary"
| ||||
| child of | 0012024 | new | 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 |
| 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: wallet--demo-scenarios-menu.diff | |
| 2026-11-10 23:43 | bot-cg | File Added: wallet--demo-scenarios-menu--before.png | |
| 2026-11-10 23:43 | bot-cg | File Added: wallet--demo-scenarios-menu--after.png |