Selaa lähdekoodia

双击编辑蓝底选中消除

zhouna 6 vuotta sitten
vanhempi
commit
98f3939410

+ 1 - 0
src/components/NumberDrop/index.jsx

@@ -214,6 +214,7 @@ class NumberDrop extends Component{
     return className(isSelected,noTag,blueBorder,orgBorder);
   }
   changeToEdit(e){        //整个标签双击编辑状态
+    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
     const {value,id,handleDbclick,patId,handleHide,show} = this.props;
     clearTimeout(this.state.timer);//取消延时的单击事件
     e.preventDefault();

+ 1 - 0
src/components/NumberUnitDrop/index.jsx

@@ -152,6 +152,7 @@ class NumberUnitDrop extends Component{
   }
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();
+    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
     const {value,id,handleDbclick,patId,handleHide,show} = this.props;
     const text = e.target.innerText || e.target.innerHTML;
     clearTimeout(this.state.timer);//取消延时的单击事件

+ 1 - 0
src/components/RadioDrop/index.jsx

@@ -129,6 +129,7 @@ class RadioDrop extends Component{
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }
   handledbClick(e){
+    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
     const {value,id,handleDbclick,patId} = this.props;
     clearTimeout(this.state.timer);//取消延时的单击事件
     //e.preventDefault();

+ 1 - 0
src/components/SpreadDrop/index.jsx

@@ -103,6 +103,7 @@ class SpreadDrop extends Component{
   }
 
   changeToEdit(e){//双击
+    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
     const {value,id,placeholder,handleDbclick,handleHide} = this.props;
     let text = e.target.innerText || e.target.innerHTML;
     handleHide&&handleHide();       //展开情况下双击收起