Repository navigation
[menu] Open submenus on Android TalkBack press - #5384
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,231.69 ms -202.18 ms(-14.1%) | Renders: 78 (+0) | Paint: 1,968.98 ms -267.80 ms(-12.0%)
11 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@claude review |
PR reviewNothing merge-blocking. The Bugs (2)1. ℹ️ Desktop 0×0 virtual-pointer heuristic now gates open logic, not just focusLocation: pointerTypeRef.current =
isMouseLikePointerType(event.pointerType, true) &&
isVirtualPointerEvent(event.nativeEvent)
? 'virtual'
: event.pointerType;On non-Android platforms, Failure scenario: A digitizer/stylus (reported as Fix: None required; optionally tighten the non-Android branch (e.g. also require 2. ℹ️ Virtual presses can open a hover submenu but never close it from the triggerLocation: toggle: !openOnHover,
ignoreMouse: openOnHover,With default Failure scenario: TalkBack user opens the submenu via the new path, double-taps the trigger again expecting it to collapse — nothing happens. Fix: Likely acceptable (consistent with the non-toggle contract for hover triggers, and back gesture/Escape work); flagging so it's a deliberate choice rather than an accident. VerdictApprove — no user-visible regressions found; the change is narrowly scoped to the intended TalkBack path and is pinned by a test that fails on the base commit. 🤖 Review generated with Claude Code |
A TalkBack double-tap on
Menu.SubmenuTriggerwith the defaultopenOnHoverdoes nothing. TalkBack activates elements with a virtual mouse press (1×1, zero-pressurepointerdownwithpointerType: 'mouse', thenmousedownand adetail: 0click), souseClicklatchesmouseandignoreMouseswallows the whole press — and the hover path can't rescue it since opening is gated on real mouse movement (allowMouseEnter).useClicknow latches'virtual'as the pointer type when a mouse-likepointerdownmatchesisVirtualPointerEvent. The value isn't mouse-like, soignoreMouselets the press open onmousedown, while remaining truthy so the existing guard still swallows the trailing click (no immediate re-toggle whenopenOnHover={false}). Virtualtouchpresses (iOS VoiceOver) keep their type sotouchOpenDelaystill applies.The tests live in a separate file because
isVirtualPointerEventonly recognizes the TalkBack shape when the platform reports Android, so the file mocks@base-ui/utils/platformwithout leaking into sibling suites.