[Bug]: Legends overflow menu warns "You are using both MenuList and Menu props" every time it opens
Charting Control
Legends
Package version
@fluentui/[email protected] (also present on master at 9c0797a)
React version
19.3.1
Environment
System:
OS: Windows 11 10.0.26300
CPU: (24) x64 AMD Ryzen 9 7900X 12-Core Processor
Memory: 12.84 GB / 31.16 GB
Browsers:
Chrome: 155.0.8059.85
Edge: Chromium
npmPackages:
@fluentui/react-charts: 9.3.28
react: 19.3.1
react-dom: 19.3.1
@types/react: 19.3.0
Current Behavior
Opening the Legends overflow menu logs this warning once per open, in development builds:
You are using both MenuList and Menu props, we recommend you to use Menu props when available
The overflow UI itself is correct. With 12 legends in a 220px container the trigger renders "+11 more" and the menu renders 11 matching rows, so only the warning is wrong.
Cause: OverflowMenu passes checkedValues to MenuList inside a Menu that owns the selection context. https://github.com/microsoft/fluentui/blob/master/packages/charts/react-charts/library/src/components/Legends/OverflowMenu.tsx
useMenuList_unstable calls usingPropsAndMenuContext, which iterates every key in the always-present Menu context and warns when a MenuList prop shares a key. checkedValues is always part of that context, so passing it to MenuList inside a Menu warns every time the popover mounts.
This is a follow-up to #36641 and #36691. The stale-count crash from those is fixed and verified on 9.3.28 (the label always equals the rendered row count); this is the remaining issue in the same component.
Expected Behavior
No warning. Passing the controlled selection to Menu is the pattern the warning recommends, and MenuList then reads it from context:
Fix PR: #36944. It moves checkedValues from MenuList to Menu in OverflowMenu and adds the regression test to the existing Legends - dynamic overflow harness.