mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
refactor: remove span[disabled]
This commit is contained in:
parent
27a17428de
commit
9c7cec3e39
@ -226,7 +226,7 @@ export default class RangePicker extends React.Component<any, any> {
|
||||
const start = inputValue[0];
|
||||
const end = inputValue[1];
|
||||
return (
|
||||
<span className={props.pickerInputClass} disabled={props.disabled}>
|
||||
<span className={props.pickerInputClass}>
|
||||
<input
|
||||
disabled={props.disabled}
|
||||
readOnly
|
||||
|
@ -39,7 +39,7 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
&:hover &-input:not([disabled]) {
|
||||
&:hover &-input:not(.@{ant-prefix}-input-disabled) {
|
||||
border-color: @primary-color;
|
||||
}
|
||||
|
||||
|
@ -65,11 +65,10 @@ export default function wrapPicker(Picker, defaultFormat?: string): any {
|
||||
const pickerClass = classNames({
|
||||
[`${prefixCls}-picker`]: true,
|
||||
});
|
||||
const pickerInputClass = classNames({
|
||||
[`${prefixCls}-picker-input`]: true,
|
||||
[inputPrefixCls]: true,
|
||||
const pickerInputClass = classNames(`${prefixCls}-picker-input`, inputPrefixCls, {
|
||||
[`${inputPrefixCls}-lg`]: props.size === 'large',
|
||||
[`${inputPrefixCls}-sm`]: props.size === 'small',
|
||||
[`${inputPrefixCls}-disabled`]: props.disabled,
|
||||
});
|
||||
|
||||
const locale = getComponentLocale(
|
||||
|
@ -192,10 +192,11 @@ export default class Input extends Component<InputProps, any> {
|
||||
]);
|
||||
|
||||
const prefixCls = props.prefixCls;
|
||||
const inputClassName = classNames(prefixCls, {
|
||||
const inputClassName = classNames(prefixCls, props.className, {
|
||||
[`${prefixCls}-sm`]: props.size === 'small',
|
||||
[`${prefixCls}-lg`]: props.size === 'large',
|
||||
}, props.className);
|
||||
[`${prefixCls}-disabled`]: props.disabled,
|
||||
});
|
||||
|
||||
if ('value' in props) {
|
||||
otherProps.value = fixControlledValue(props.value);
|
||||
|
@ -63,7 +63,7 @@
|
||||
.active();
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
&-disabled {
|
||||
.disabled();
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&:hover .@{inputClass} {
|
||||
&:hover .@{inputClass}:not(.@{inputClass}-disabled) {
|
||||
.hover();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user