1.0.0.0725

1.修改返回顶部页面会颤抖的问题
2.新增下拉框可视范围内自动向上
3.新增自定义样式
This commit is contained in:
maplemei
2019-07-25 10:10:33 +08:00
parent 33df4d95d8
commit ba563c67c4
7 changed files with 130 additions and 21 deletions

View File

@@ -9,7 +9,6 @@ class General extends Component{
super(options);
this.searchCid = 0;
this.setState({ searchVal: '', });
this.viewRef = null;
}
optionClick(item, selected, disabled, e){
@@ -31,15 +30,9 @@ class General extends Component{
if(!props.show){
//清空输入框的值
this.setState({ searchVal: '', });
this.goTop();
}
}
goTop(){
//返回顶部
this.viewRef.scrollIntoView(true);
}
render({ data, prop, template, theme, sels, empty, filterable, filterMethod, delay, searchTips }) {
const { name, value, disabled } = prop;
@@ -75,12 +68,8 @@ class General extends Component{
</div>
);
const onRef = (ref) => {
this.viewRef = ref;
};
return (
<div ref={ onRef }>
<div>
{ search }
<div>{ arr }</div>
</div>