|
@@ -146,9 +146,9 @@ class EditableSpan extends Component{
|
|
|
|
|
|
handleKeydown(e){
|
|
|
const ev = e||window.event;
|
|
|
- const {i} = this.props;
|
|
|
+ const {i,setSearchLocation} = this.props;
|
|
|
const target = ev.target||ev.srcElement;
|
|
|
- let innerVal = target.innerText;
|
|
|
+ let innerVal = target.innerText || target.innerHTML,ele,boxTop;
|
|
|
//禁止回车事件
|
|
|
if(ev.keyCode==13){return false;}
|
|
|
//backspace事件
|
|
@@ -185,6 +185,9 @@ class EditableSpan extends Component{
|
|
|
obj.focus();
|
|
|
}
|
|
|
}
|
|
|
+ ele = document.activeElement;
|
|
|
+ boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
|
|
|
+ setSearchLocation(boxTop,ele.offsetLeft) //搜索框的位置动态获取
|
|
|
}
|
|
|
handleKeyup(e){
|
|
|
const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable,setSearchLocation} = this.props;
|