-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[MenuItem] Add an anchorOrigin property for the nested items #6079
Conversation
+1 we need this! |
src/MenuItem/MenuItem.js
Outdated
@@ -59,6 +59,10 @@ class MenuItem extends Component { | |||
|
|||
static propTypes = { | |||
/** | |||
* Override the default anchorOrigin children used. | |||
*/ | |||
anchorOrigin: PropTypes.object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the utils/propTypes.origin
helper. You can have a look at the other components to see how it's done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/MenuItem/MenuItem.js
Outdated
@@ -59,6 +59,10 @@ class MenuItem extends Component { | |||
|
|||
static propTypes = { | |||
/** | |||
* Override the default anchorOrigin children used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to improve the wording. We should refer to the nested menu at least.
Here is what we have on the Popover:
/**
* This is the point on the anchor where the popover's
* `targetOrigin` will attach to.
* Options:
* vertical: [top, center, bottom]
* horizontal: [left, middle, right].
*/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated wording to:
Location of the anchor for the popover of nested `MenuItem` elements.
[MenuItem] Use util/propTypes origin helper for propType for anchorOrigin propType
Thanks. |
This gives similar functionality as animation prop to childMenuPopover.