提交 7a4080ec 编写于 作者: 陆离 提交者: 偏右

Fix some problems of AutoCompelete demo (#4942)

+ close #4912
上级 b90237ee
......@@ -47,7 +47,7 @@ function renderOption(item) {
{item.category}
</a>
区块中
<span style={{ float: 'right' }}>{item.count} 个结果</span>
<span className="global-search-item-count">{item.count} 个结果</span>
</Option>
);
}
......@@ -128,11 +128,17 @@ ReactDOM.render(<Complete />, mountNode);
}
.global-search.ant-select-auto-complete .ant-input-preSuffix-wrapper .ant-input-suffix {
right: 0;
right: 1px;
}
.global-search.ant-select-auto-complete .ant-input-preSuffix-wrapper .ant-input-suffix button {
border-radius: 3px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.global-search-item-count {
position: absolute;
right: 16px;
}
````
---
category: Components
type: Data Entry
cols: 1
cols: 2
title: AutoComplete
---
......
......@@ -39,17 +39,18 @@ export interface AutoCompleteProps extends AbstractSelectProps {
}
class InputElement extends React.Component<any, any> {
private ele: Element;
private ele: HTMLInputElement;
focus = () => {
(findDOMNode(this.ele) as HTMLInputElement).focus();
this.ele.focus ? this.ele.focus() : (findDOMNode(this.ele) as HTMLInputElement).focus();
}
blur = () => {
(findDOMNode(this.ele) as HTMLInputElement).blur();
this.ele.blur ? this.ele.blur() : (findDOMNode(this.ele) as HTMLInputElement).blur();
}
render() {
return React.cloneElement(this.props.children, {
...this.props,
ref: ele => this.ele = ele,
ref: ele => this.ele = (ele as HTMLInputElement),
}, null);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册