@@ -11,7 +11,7 @@ import './select-styles.scss';
11
11
import Input from './input' ;
12
12
import Menu from './menu' ;
13
13
14
- const InternalSelect = ( { onChange, options, value, simpleValue, placeholder, isSearchable, ...props } ) => {
14
+ const InternalSelect = ( { onChange, options, value, simpleValue, placeholder, isSearchable, isDisabled , ...props } ) => {
15
15
// console.log(props);
16
16
const inputRef = useRef ( ) ;
17
17
const parsedValue = parseInternalValue ( value ) ;
@@ -37,9 +37,18 @@ const InternalSelect = ({ onChange, options, value, simpleValue, placeholder, is
37
37
} ;
38
38
return (
39
39
< div className = "pf-c-select" >
40
- < button className = " pf-c-select__toggle" { ...enhancedToggleButtonProps } >
40
+ < button disabled = { isDisabled } className = { ` pf-c-select__toggle${ isDisabled ? ' pf-m-disabled' : '' } ` } { ...enhancedToggleButtonProps } >
41
41
< div className = "pf-c-select_toggle-wrapper ddorg__pf4-component-mapper__select-toggle-wrapper" >
42
- < Input inputRef = { inputRef } placeholder = { placeholder } className = "pf-c-select_toggle-text" { ...getInputProps ( ) } value = { value } />
42
+ < Input
43
+ inputRef = { inputRef }
44
+ isSearchable = { isSearchable }
45
+ placeholder = { placeholder }
46
+ className = "pf-c-select_toggle-text"
47
+ { ...getInputProps ( {
48
+ disabled : isDisabled
49
+ } ) }
50
+ value = { value }
51
+ />
43
52
</ div >
44
53
< span className = "pf-c-select__toggle-arrow" >
45
54
< CaretDownIcon />
@@ -66,8 +75,9 @@ InternalSelect.propTypes = {
66
75
placeholder : PropTypes . string ,
67
76
isSearchable : PropTypes . bool ,
68
77
id : PropTypes . string ,
69
- name : PropTypes . string . isRequired
70
- }
78
+ name : PropTypes . string . isRequired ,
79
+ isDisabled : PropTypes . bool
80
+ } ;
71
81
72
82
const Select = ( { selectVariant, menuIsPortal, ...props } ) => {
73
83
const isSearchable = selectVariant === 'createable' || props . isSearchable ;
0 commit comments