fix: 去掉 select 中的无用代码

This commit is contained in:
wuduoyi 2022-07-08 14:20:00 +08:00 committed by RUNZE LU
parent f4df1654ca
commit 61cb1aecb0

View File

@ -729,13 +729,6 @@ export class Select extends React.Component<SelectProps, SelectState> {
onDelete && onDelete(item);
}
@autobind
menuItemRef(ref: any) {
if (ref && typeof ref.offsetHeight === 'number' && ref > 0) {
this.setState({itemHeight: ref.offsetHeight});
}
}
renderValue({inputValue, isOpen}: ControllerStateAndHelpers<any>) {
const {
classnames: cx,
@ -1167,14 +1160,6 @@ export class Select extends React.Component<SelectProps, SelectState> {
</div>
) : null}
<div ref={this.menuItemRef} className={cx('Select-option hidden')}>
{multiple ? (
<Checkbox size="sm">Placeholder</Checkbox>
) : (
<span>Placeholder</span>
)}
</div>
{creatable && !disabled ? (
<a className={cx('Select-addBtn')} onClick={this.handleAddClick}>
<Icon icon="plus" className="icon" />