Skip to content

Commit 1801e67

Browse files
[SelectField] Add the maxHeight property back to the example
1 parent c2c4d94 commit 1801e67

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

docs/src/app/components/pages/components/SelectField/ExampleLongMenu.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, {Component} from 'react';
22
import SelectField from 'material-ui/SelectField';
33
import MenuItem from 'material-ui/MenuItem';
44

@@ -11,18 +11,20 @@ for (let i = 0; i < 100; i++ ) {
1111
* With the `maxHeight` property set, the Select Field will be scrollable if the number of items causes the height to
1212
* exceed this limit.
1313
*/
14-
export default class DropDownMenuLongMenuExample extends React.Component {
14+
export default class DropDownMenuLongMenuExample extends Component {
1515

1616
constructor(props) {
1717
super(props);
1818
this.state = {value: 10};
1919
}
2020

21-
handleChange = (event, index, value) => this.setState({value});
21+
handleChange = (event, index, value) => {
22+
this.setState({value});
23+
};
2224

2325
render() {
2426
return (
25-
<SelectField value={this.state.value} onChange={this.handleChange}>
27+
<SelectField value={this.state.value} onChange={this.handleChange} maxHeight={200}>
2628
{items}
2729
</SelectField>
2830
);

0 commit comments

Comments
 (0)