[web] Fix MenuAnchor dismiss when semantics enabled by flushing pointer events for non-merged nodes by flutter-zl · Pull Request #183093 · flutter/flutter
Fixes #167487
Problem
When semantics are enabled, MenuAnchor does not close when clicking outside it. ClickDebouncer was converting all debounced clicks to SemanticsAction.tap, which bypasses the pointer event pipeline. TapRegionSurface never saw a PointerDownEvent, so onTapOutside was never called and the menu stayed open.
Fix
ClickDebouncer.onClick now flushes queued pointer events for non-merged nodes, so TapRegionSurface sees them and correctly calls onTapOutside. Merged nodes (e.g. CheckboxListTile with MergeSemantics) still use SemanticsAction.tap to avoid coordinate miss-hits on the inner widget (preserving the fix for #130162). A mergesDescendants flag is threaded from SemanticsNode through the engine to ClickDebouncer to distinguish the two cases.
Demo
Before change
https://flutter-demo-14-before.web.app
After change
https://flutter-demo-14-after.web.app
Steps: click Open Menu → click Button A outside the menu.
Before: button fires but menu stays open.
After: button fires and menu closes.