flutter/examples/api/test/material/menu_anchor
davidhicks980 faabe3af72
[material/menu_anchor.dart] MenuAnchor focus refactoring for RawMenuAnchor (#150950)
This PR is aimed at (1) reducing the private API surface of _MenuAnchorState to make migration into RawMenuAnchor simpler, and (2) fixing focus-related bugs. 

Directional focus handling was moved from MenuAnchor (_MenuDirectionalFocusAction, _MenuNextFocusAction, and _MenuPreviousFocusAction) into SubmenuButton (_SubmenuDirectionalFocusAction). MenuAnchor now behaves similarly to a flat FocusScope, which makes it easier to customize. A future PR will ideally expose or remove the remaining internals (_lastItemFocusNode, _firstItemFocusNode, _isRoot, etc). All previous framework tests are passing, and additional tests were added for fixes (MenuAnchor tab traversal, reopened menus not being focusable), and to test MenuAnchor focus behavior separately from MenuBar. 

However, [one example test](https://github.com/flutter/flutter/pull/150950/files#diff-a33fa01b59d280784e7c8ed6b704bd005cde95b7d3b649dc82fd58530061a09d) had to be changed. I'm not sure why the previous example test was working to begin with, as submenu buttons are supposed to open on focus, but this behavior was not observed in the original test. 

Fixes https://github.com/flutter/flutter/issues/144381, https://github.com/flutter/flutter/issues/150334.

One added feature is the ability to move between top-level horizontal submenus if a horizontal movement is made on a vertical menu item that has no children in the movement direction. This behavior was observed on Google Docs, MacOS, and various other menu systems I encountered.

https://github.com/flutter/flutter/assets/59215665/04a42b8a-cc9e-4a50-9d0c-6f2d784cfc78
2024-08-06 19:04:11 +00:00
..
checkbox_menu_button.0_test.dart Update menu examples for SafeArea (#132390) 2023-08-14 20:30:01 +00:00
menu_accelerator_label.0_test.dart Update default menu text styles for Material 3 (#131930) 2023-08-22 22:21:00 +00:00
menu_anchor.0_test.dart [material/menu_anchor.dart] MenuAnchor focus refactoring for RawMenuAnchor (#150950) 2024-08-06 19:04:11 +00:00
menu_anchor.1_test.dart Convert menus to use OverlayPortal (#130534) 2023-10-18 20:13:08 +00:00
menu_anchor.2_test.dart Add test for menu_anchor.2.dart (#151399) 2024-07-12 18:03:26 +00:00
menu_anchor.3_test.dart Add a simplified SimpleCascadingMenuApp example (#149147) 2024-06-03 17:11:36 +00:00
menu_bar.0_test.dart Update menu examples for SafeArea (#132390) 2023-08-14 20:30:01 +00:00
radio_menu_button.0_test.dart Update menu examples for SafeArea (#132390) 2023-08-14 20:30:01 +00:00