forked from p96170835/amis
优化 Tag 输入的 disabled 状态
This commit is contained in:
parent
b94a0a4f36
commit
0f08fda189
|
@ -5,6 +5,11 @@
|
|||
border-radius: 0;
|
||||
}
|
||||
|
||||
&-input.is-disabled {
|
||||
border-style: dashed;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&.is-inline {
|
||||
display: inline-block;
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ export class ResultBox extends React.Component<ResultBoxProps> {
|
|||
onResultClick ? 'is-clickable' : ''
|
||||
)}
|
||||
onClick={onResultClick}
|
||||
tabIndex={!allowInput && onFocus ? 0 : -1}
|
||||
tabIndex={!allowInput && !disabled && onFocus ? 0 : -1}
|
||||
onKeyPress={allowInput ? undefined : onKeyPress}
|
||||
onFocus={allowInput ? undefined : onFocus}
|
||||
onBlur={allowInput ? undefined : onBlur}
|
||||
|
@ -139,20 +139,22 @@ export class ResultBox extends React.Component<ResultBoxProps> {
|
|||
<span className={cx('ResultBox-valueLabel')}>
|
||||
{itemRender(item)}
|
||||
</span>
|
||||
<a data-index={index} onClick={this.removeItem}>
|
||||
<Icon icon="close" className="icon" />
|
||||
</a>
|
||||
{!disabled ? (
|
||||
<a data-index={index} onClick={this.removeItem}>
|
||||
<Icon icon="close" className="icon" />
|
||||
</a>
|
||||
) : null}
|
||||
</div>
|
||||
))
|
||||
) : result && !Array.isArray(result) ? (
|
||||
<span className={cx('ResultBox-singleValue')}>{result}</span>
|
||||
) : allowInput ? null : (
|
||||
) : allowInput && !disabled ? null : (
|
||||
<span className={cx('ResultBox-placeholder')}>
|
||||
{__(placeholder || '无')}
|
||||
</span>
|
||||
)}
|
||||
|
||||
{allowInput ? (
|
||||
{allowInput && !disabled ? (
|
||||
<Input
|
||||
{...rest}
|
||||
onKeyPress={onKeyPress}
|
||||
|
|
Loading…
Reference in New Issue