Pārlūkot izejas kodu

滚动条刷新容错

zhouna 5 gadi atpakaļ
vecāks
revīzija
2fb00285b3

+ 1 - 1
src/common/components/ItemBox/index.jsx

@@ -53,7 +53,7 @@ componentWillReceiveProps(nextP){
       const that = this;
       //数据渲染后更新滚动条
       setTimeout(function(){
-        that.context.scrollArea.refresh();
+        that.context.scrollArea&&that.context.scrollArea.refresh();
       });
     }
 }

+ 2 - 2
src/common/components/SearchOption/index.jsx

@@ -42,10 +42,10 @@ class SearchOption extends React.Component {
       this.textInput.current.focus();
       const {windowHeight,pageTop,height,refreshScroller} = this.props;
 
-      refreshScroller().refresh();    //点开搜索弹窗更新滚动条,
+      refreshScroller()&&refreshScroller().refresh();    //点开搜索弹窗更新滚动条,
       if(windowHeight - pageTop < height){
         //$("#searchOption")[0].scrollIntoView(false);
-        refreshScroller().scrollBottom();
+        refreshScroller()&&refreshScroller().scrollBottom();
       }
     }
     handleClearVal(){

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

@@ -28,7 +28,7 @@ class DiagResultSearch extends Component {
         } else {
           if (e.target != diagSearch && e.target != addDiag && e.target.parentNode != addDiag && !$.contains(diagSearch, e.target)) {
             that.props.hideSearch();
-            that.props.setHighter(0)
+            that.props.setHighter(48)
           }
 
 

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

@@ -72,7 +72,7 @@ class DiagnosticItem extends Component{
          addDiagnostic&&addDiagnostic(item);
          clearInput&&clearInput();
          hideSearch&&hideSearch();
-        this.context.scrollArea.refresh();
+        this.context.scrollArea&&this.context.scrollArea.refresh();
          //document.getElementById("diagnosisResult").scrollIntoView(true)
     }
     handleMouseEnterDrug() {

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

@@ -286,7 +286,7 @@ class Operation extends Component {
       //更新滚动条
       const that = this;
       setTimeout(function(){
-        that.context.scrollArea.refresh();
+        that.context.scrollArea&&that.context.scrollArea.refresh();
       });
     } else if (type == 3) {
       if (this.state.title.trim() == '') {