Forráskód Böngészése

杂音类型超出屏幕bug修改2595

zhouna 5 éve
szülő
commit
564f4fe956

+ 7 - 2
src/components/SpreadDrop/index.jsx

@@ -73,9 +73,14 @@ class SpreadDrop extends Component{
       }
     });
     const listWidth = 30+$(this.$list.current).width();
-    if(num >= 4 && windowWidth-getPageCoordinate(e).boxLeft < listWidth){
+    const wleft = getPageCoordinate(e).boxLeft;
+    if(num >= 4 && windowWidth-wleft < listWidth){
       this.setState({
-        left:windowWidth-listWidth-150
+        left:windowWidth-wleft-listWidth-50
+      })
+    }else{
+      this.setState({
+        left:'auto'
       })
     }
     //高度超出时,增加左侧大容器padding

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

@@ -1,7 +1,7 @@
 @import "~@less/mixin.less";
 
 .container{
-  /*position: relative;*/
+  position: relative;
   display: inline-block;
   .selected-tag{
     cursor: pointer;