Selected value in Cascader should be gray when focus search input

This commit is contained in:
afc163 2018-07-03 15:46:12 +08:00
parent 4aabc53744
commit cde8bc8361
2 changed files with 7 additions and 1 deletions

View File

@ -341,7 +341,7 @@ export default class Cascader extends React.Component<CascaderProps, CascaderSta
prefixCls, inputPrefixCls, children, placeholder, size, disabled,
className, style, allowClear, showSearch = false, ...otherProps
} = props;
const value = state.value;
const { value, inputFocused } = state;
const sizeCls = classNames({
[`${inputPrefixCls}-lg`]: size === 'large',
@ -364,6 +364,7 @@ export default class Cascader extends React.Component<CascaderProps, CascaderSta
[`${prefixCls}-picker-disabled`]: disabled,
[`${prefixCls}-picker-${size}`]: !!size,
[`${prefixCls}-picker-show-search`]: !!showSearch,
[`${prefixCls}-picker-focused`]: inputFocused,
});
// Fix bug of https://github.com/facebook/react/pull/5004

View File

@ -28,6 +28,7 @@
background-color: @component-background;
border-radius: @border-radius-base;
outline: 0;
transition: color .3s;
&-with-value &-label {
color: transparent;
@ -46,6 +47,10 @@
.active;
}
&-show-search&-focused {
color: @disabled-color;
}
&-label {
position: absolute;
left: 0;