|
@@ -40,13 +40,14 @@ class Multiple extends react.Component{
|
|
|
const {show,value,hideTag,isImports,isExtBlue} = this.props;
|
|
|
const orgBorder = isImports&&!value?style['orange-border']:'';
|
|
|
const ext = isExtBlue?style['ext']:'';
|
|
|
+ const editBorder = this.state.editable?style['blue-border']:'';
|
|
|
if(show){
|
|
|
$(this.$div.current).addClass(style['borderd']);
|
|
|
}else{
|
|
|
$(this.$div.current).removeClass(style['borderd']);
|
|
|
}
|
|
|
if(value){
|
|
|
- return hideTag?classNames(style['hide-tag'],orgBorder):classNames(style['selected-tag'],orgBorder);
|
|
|
+ return hideTag?classNames(style['hide-tag'],orgBorder):classNames(style['selected-tag'],orgBorder,editBorder);
|
|
|
}
|
|
|
return hideTag?'':classNames(style['tag'],orgBorder,ext);
|
|
|
}
|
|
@@ -84,6 +85,7 @@ class Multiple extends react.Component{
|
|
|
changeToEdit(e){//双击
|
|
|
const {value,id,placeholder,handleDbclick,handleHide} = this.props;
|
|
|
let text = e.target.innerText || e.target.innerHTML;
|
|
|
+ window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
|
|
|
handleHide&&handleHide(); //展开情况下双击收起
|
|
|
// clearTimeout(this.state.timer);//取消延时的单击事件
|
|
|
e.stopPropagation();
|
|
@@ -92,7 +94,9 @@ class Multiple extends react.Component{
|
|
|
labelVal:text,
|
|
|
editable:true
|
|
|
});
|
|
|
- e.target.focus();
|
|
|
+ /*setTimeout(()=>{
|
|
|
+ e.target.focus();
|
|
|
+ })*/
|
|
|
handleDbclick && handleDbclick({value,id,placeholder});
|
|
|
}
|
|
|
}
|