Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MenuRoot] Remove wrong default value from docs #549

Merged
merged 7 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/base-ui/api/menu-root.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"loop": { "type": { "name": "bool" }, "default": "true" },
"onOpenChange": { "type": { "name": "func" } },
"open": { "type": { "name": "bool" } },
"openOnHover": { "type": { "name": "bool" }, "default": "nested" },
"openOnHover": { "type": { "name": "bool" } },
"orientation": {
"type": { "name": "enum", "description": "'horizontal'<br>&#124;&nbsp;'vertical'" },
"default": "'vertical'"
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/api-docs/menu-root/menu-root.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"description": "Allows to control whether the dropdown is open. This is a controlled counterpart of <code>defaultOpen</code>."
},
"openOnHover": {
"description": "Whether the menu popup opens when the trigger is hovered after the provided <code>delay</code>."
"description": "Whether the menu popup opens when the trigger is hovered after the provided <code>delay</code>. By default, openOnHover is set to <code>true</code> for nested menus."
},
"orientation": { "description": "The orientation of the Menu (horizontal or vertical)." }
},
Expand Down
6 changes: 2 additions & 4 deletions packages/mui-base/src/Menu/Root/MenuRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ namespace MenuRoot {
delay?: number;
/**
* Whether the menu popup opens when the trigger is hovered after the provided `delay`.
*
* @default nested
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used to have such a prop in one of the previous implementation attempts and forgot to remove the @default annotation. We can add in plain text that by default openOnHover is set on nested menus.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* By default, openOnHover is set to `true` for nested menus.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* By default, openOnHover is set to `true` for nested menus.
* By default, `openOnHover` is set to `true` for nested menus.

*/
openOnHover?: boolean;
}
Expand Down Expand Up @@ -211,8 +210,7 @@ MenuRoot.propTypes /* remove-proptypes */ = {
open: PropTypes.bool,
/**
* Whether the menu popup opens when the trigger is hovered after the provided `delay`.
*
* @default nested
* By default, openOnHover is set to `true` for nested menus.
*/
openOnHover: PropTypes.bool,
/**
Expand Down