Skip to content

Commit 99a584f

Browse files
authored
fix(menu): correct legacyAutoalign default value (#21492)
1 parent 7988f34 commit 99a584f

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6237,6 +6237,9 @@ Map {
62376237
"label": {
62386238
"type": "string",
62396239
},
6240+
"legacyAutoalign": {
6241+
"type": "bool",
6242+
},
62406243
"menuAlignment": {
62416244
"type": "string",
62426245
},

packages/react/src/components/Menu/Menu.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ export interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
113113
*/
114114
y?: number | [number, number];
115115

116+
/**
117+
* @deprecated Internal compatibility flag. Use `false` to enable auto-alignment behavior.
118+
*/
116119
legacyAutoalign?: boolean;
117120
}
118121

@@ -129,7 +132,7 @@ const Menu = forwardRef<HTMLUListElement, MenuProps>(function Menu(
129132
onOpen,
130133
open,
131134
size = 'sm',
132-
legacyAutoalign = 'true',
135+
legacyAutoalign = true,
133136
target = canUseDOM && document.body,
134137
x = 0,
135138
y = 0,
@@ -574,6 +577,11 @@ Menu.propTypes = {
574577
PropTypes.number,
575578
PropTypes.arrayOf(PropTypes.number),
576579
]),
580+
581+
/**
582+
* @deprecated Internal compatibility flag. Use `false` to enable auto-alignment behavior.
583+
*/
584+
legacyAutoalign: PropTypes.bool,
577585
};
578586

579587
export { Menu };

0 commit comments

Comments
 (0)