@@ -24,6 +24,7 @@ let DropDownMenu = React.createClass({
24
24
displayMember : React . PropTypes . string ,
25
25
valueMember : React . PropTypes . string ,
26
26
autoWidth : React . PropTypes . bool ,
27
+ disabled : React . PropTypes . bool ,
27
28
onChange : React . PropTypes . func ,
28
29
menuItems : React . PropTypes . array . isRequired ,
29
30
menuItemStyle : React . PropTypes . object ,
@@ -65,6 +66,7 @@ let DropDownMenu = React.createClass({
65
66
66
67
getStyles ( ) {
67
68
let zIndex = 5 ; // As AppBar
69
+ let disabled = this . props . disabled ;
68
70
let spacing = this . context . muiTheme . spacing ;
69
71
let accentColor = this . context . muiTheme . component . dropDownMenu . accentColor ;
70
72
let backgroundColor = this . context . muiTheme . component . menu . backgroundColor ;
@@ -78,7 +80,7 @@ let DropDownMenu = React.createClass({
78
80
outline : 'none' ,
79
81
} ,
80
82
control : {
81
- cursor : 'pointer' ,
83
+ cursor : disabled ? 'not-allowed' : 'pointer' ,
82
84
position : 'static' ,
83
85
height : '100%' ,
84
86
} ,
@@ -102,7 +104,7 @@ let DropDownMenu = React.createClass({
102
104
paddingLeft : spacing . desktopGutter ,
103
105
top : 0 ,
104
106
opacity : 1 ,
105
- color : this . context . muiTheme . palette . textColor ,
107
+ color : disabled ? this . context . muiTheme . palette . disabledColor : this . context . muiTheme . palette . textColor ,
106
108
} ,
107
109
underline : {
108
110
borderTop : 'solid 1px ' + accentColor ,
@@ -240,7 +242,9 @@ let DropDownMenu = React.createClass({
240
242
} ,
241
243
242
244
_onControlClick ( ) {
243
- this . setState ( { open : ! this . state . open } ) ;
245
+ if ( ! this . props . disabled ) {
246
+ this . setState ( { open : ! this . state . open } ) ;
247
+ }
244
248
} ,
245
249
246
250
_onKeyDown ( e ) {
0 commit comments