Skip to content

Commit

Permalink
fix: restore Menu#anchorEl documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Mar 25, 2020
1 parent d8baa07 commit 9212d46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/pages/api-docs/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">anchorEl</span> | <span class="prop-type">func<br>&#124;&nbsp;Element</span> | | The DOM element used to set the position of the menu. |
| <span class="prop-name">autoFocus</span> | <span class="prop-type">bool</span> | <span class="prop-default">true</span> | If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled children are not focusable. If you set this prop to `false` focus will be placed on the parent modal container. This has severe accessibility implications and should only be considered if you manage focus otherwise. |
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | Menu contents, normally `MenuItem`s. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
Expand Down
1 change: 1 addition & 0 deletions packages/material-ui/src/Menu/Menu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface MenuProps
extends StandardProps<PopoverProps & Partial<TransitionHandlerProps>, MenuClassKey> {
/**
* The DOM element used to set the position of the menu.
* @document
*/
anchorEl?: PopoverProps['anchorEl'];
/**
Expand Down
7 changes: 7 additions & 0 deletions packages/material-ui/src/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ Menu.propTypes = {
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* The DOM element used to set the position of the menu.
*/
anchorEl: PropTypes.oneOfType([
PropTypes.func,
PropTypes.instanceOf(typeof Element === 'undefined' ? Object : Element),
]),
/**
* If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled
* children are not focusable. If you set this prop to `false` focus will be placed
Expand Down

0 comments on commit 9212d46

Please sign in to comment.