|
@@ -3,7 +3,7 @@ import style from './index.less';
|
|
|
import {Button,InlineTag,ItemBox,EditableSpan,Notify} from '@commonComp';
|
|
|
import chooseType from '@containers/eleType.js';
|
|
|
import SearchDrop from '@components/SearchDrop';
|
|
|
-import {getPageCoordinate,windowEventHandler} from '@utils/tools';
|
|
|
+import {getPageCoordinate,windowEventHandler,isIE} from '@utils/tools';
|
|
|
import $ from "jquery";
|
|
|
|
|
|
class CheckBody extends Component{
|
|
@@ -42,14 +42,21 @@ class CheckBody extends Component{
|
|
|
return ;
|
|
|
}
|
|
|
//若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
|
|
|
- const ele = document.activeElement;
|
|
|
- if(ele.toString().indexOf('HTMLSpanElement') == -1){ //点击的不是span无法聚焦就不再设置位置
|
|
|
- return;
|
|
|
+
|
|
|
+ let leftL=0; //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
|
|
|
+ if(isIE()){
|
|
|
+ leftL = getPageCoordinate(e).boxLeft
|
|
|
+ }else{
|
|
|
+ const ele = document.activeElement;
|
|
|
+ if(ele.toString().indexOf('HTMLSpanElement') == -1){ //点击的不是span无法聚焦就不再设置位置
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ leftL = ele.offsetLeft+90
|
|
|
}
|
|
|
- const leftL = ele.offsetLeft; //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
|
|
|
+ // console.log(leftL,getPageCoordinate(e).boxLeft)
|
|
|
this.setState({
|
|
|
// boxLeft:getPageCoordinate(e).boxLeft,
|
|
|
- boxLeft:leftL+90,
|
|
|
+ boxLeft:leftL,
|
|
|
boxTop:getPageCoordinate(e).boxTop,
|
|
|
tmpScroll: $("#addScrollEvent")[0].scrollTop,
|
|
|
tmpTop:getPageCoordinate(e).boxTop
|