Selaa lähdekoodia

子滚动条滚动优化

zhouna 5 vuotta sitten
vanhempi
commit
98cfb3c177
2 muutettua tiedostoa jossa 6 lisäystä ja 6 poistoa
  1. 5 5
      src/components/SearchDrop/index.jsx
  2. 1 1
      src/components/SpreadDrop/index.jsx

+ 5 - 5
src/components/SearchDrop/index.jsx

@@ -55,7 +55,7 @@ class SearchDrop extends Component{
     // onShow&&onShow(e,false);
   }
   render(){
-    const {mainEmpty} = this.props;
+    const {mainEmpty,data} = this.props;
     let litext = '';
     const contStyle={
       opacity:'0.4',
@@ -69,14 +69,14 @@ class SearchDrop extends Component{
       return <div className={this.getClass()} id="searchBox" style={this.getStyle()}>
         <ScrollArea speed={0.8}
                     horizontal={false}
-                    stopScrollPropagation={true}
+                    stopScrollPropagation={data.length>6?true:false}
                     style={{maxHeight:'225px'}}
                     className={style["area"]}
                     verticalContainerStyle={contStyle}
                     verticalScrollbarStyle={barStyle}
                     contentClassName="content">
           <ul>
-            {this.props.data&&this.props.data.map((it)=>{
+            {data&&data.map((it)=>{
               litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
               return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
             })}
@@ -88,14 +88,14 @@ class SearchDrop extends Component{
       return <div className={this.getClass()} id="searchBox" style={this.getStyle()}>
         <ScrollArea speed={0.8}
                     horizontal={false}
-                    stopScrollPropagation={true}
+                    stopScrollPropagation={data.length>6?true:false}
                     style={{maxHeight:'225px'}}
                     className={style["area"]}
                     verticalContainerStyle={contStyle}
                     verticalScrollbarStyle={barStyle}
                     contentClassName="content">
           <ul>
-            {this.props.data&&this.props.data.map((it)=>{
+            {data&&data.map((it)=>{
               litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
               return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
             })}

+ 1 - 1
src/components/SpreadDrop/index.jsx

@@ -486,7 +486,7 @@ class ListItem extends Component{
     return <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
     <ScrollArea speed={0.8}
     horizontal={false}
-    stopScrollPropagation={true}
+    stopScrollPropagation={datas.length>11?true:false}
     style={{maxHeight:'330px'}}
     className={style["area"]}
     verticalContainerStyle={contStyle}