@@ -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 ,
@@ -36,6 +37,7 @@ let DropDownMenu = React.createClass({
36
37
getDefaultProps ( ) {
37
38
return {
38
39
autoWidth : true ,
40
+ disabled : false ,
39
41
valueMember : 'payload' ,
40
42
displayMember : 'text' ,
41
43
} ;
@@ -64,6 +66,7 @@ let DropDownMenu = React.createClass({
64
66
} ,
65
67
66
68
getStyles ( ) {
69
+ const { disabled} = this . props ;
67
70
let zIndex = 5 ; // As AppBar
68
71
let spacing = this . context . muiTheme . spacing ;
69
72
let accentColor = this . context . muiTheme . component . dropDownMenu . accentColor ;
@@ -78,7 +81,7 @@ let DropDownMenu = React.createClass({
78
81
outline : 'none' ,
79
82
} ,
80
83
control : {
81
- cursor : 'pointer' ,
84
+ cursor : disabled ? 'not-allowed' : 'pointer' ,
82
85
position : 'static' ,
83
86
height : '100%' ,
84
87
} ,
@@ -102,7 +105,7 @@ let DropDownMenu = React.createClass({
102
105
paddingLeft : spacing . desktopGutter ,
103
106
top : 0 ,
104
107
opacity : 1 ,
105
- color : this . context . muiTheme . palette . textColor ,
108
+ color : disabled ? this . context . muiTheme . palette . disabledColor : this . context . muiTheme . palette . textColor ,
106
109
} ,
107
110
underline : {
108
111
borderTop : 'solid 1px ' + accentColor ,
@@ -240,7 +243,9 @@ let DropDownMenu = React.createClass({
240
243
} ,
241
244
242
245
_onControlClick ( ) {
243
- this . setState ( { open : ! this . state . open } ) ;
246
+ if ( ! this . props . disabled ) {
247
+ this . setState ( { open : ! this . state . open } ) ;
248
+ }
244
249
} ,
245
250
246
251
_onKeyDown ( e ) {
0 commit comments