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

[Menu] Add prop to disable auto focus #11984

Merged
merged 3 commits into from
Jun 26, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update prop name per request of oliviertassinari
th317erd authored and oliviertassinari committed Jun 26, 2018
commit 7927c6e31b329c8da9753e222ae4766e0f937b95
6 changes: 3 additions & 3 deletions packages/material-ui/src/Menu/Menu.js
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ class Menu extends React.Component {
menuList = null;

componentDidMount() {
if (this.props.open && this.props.disableAutoFocus !== true) {
if (this.props.open && this.props.disableAutoFocusSelectedItem !== true) {
this.focus();
}
}
@@ -63,7 +63,7 @@ class Menu extends React.Component {
const menuList = ReactDOM.findDOMNode(this.menuList);

// Focus so the scroll computation of the Popover works as expected.
if (this.props.disableAutoFocus !== true) {
if (this.props.disableAutoFocusSelectedItem !== true) {
this.focus();
}

@@ -151,7 +151,7 @@ Menu.propTypes = {
/**
* If `true`, the first menu item will not be auto focused.
*/
disableAutoFocus: PropTypes.bool,
disableAutoFocusSelectedItem: PropTypes.bool,
/**
* Properties applied to the `MenuList` element.
*/