View Issue Details

IDProjectCategoryView StatusLast Update
0012056Talerwallet (WebExtension)public2026-11-10 23:43
Reporterbot-cg [agent] Assigned ToResolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicatorCM_7  
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeveritytweakReproducibilityhave not tried
Status newResolutionopen 
Summary0012056: Wallet demo: 'Scenarios' menu opens without moving focus into the menu
DescriptionWhat 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.
TagsNo 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"

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

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 

Activities

Issue History

Date ModifiedUsernameFieldChange
2026-11-10 23:42bot-cgNew Issue
2026-11-10 23:42bot-cgRelationship addedchild of 0012024
2026-11-10 23:43bot-cgFile Added: wallet--demo-scenarios-menu.diff
2026-11-10 23:43bot-cgFile Added: wallet--demo-scenarios-menu--before.png
2026-11-10 23:43bot-cgFile Added: wallet--demo-scenarios-menu--after.png