|
@@ -3,8 +3,6 @@ import style from './index.less';
|
|
import config from "@config/index";
|
|
import config from "@config/index";
|
|
import {filterArr,isIE} from '@utils/tools.js';
|
|
import {filterArr,isIE} from '@utils/tools.js';
|
|
import Notify from '../Notify/index.js';
|
|
import Notify from '../Notify/index.js';
|
|
-
|
|
|
|
-import $ from 'jquery';
|
|
|
|
/*****
|
|
/*****
|
|
* author:zn@2018-12-10
|
|
* author:zn@2018-12-10
|
|
* 自由文本输入组件
|
|
* 自由文本输入组件
|
|
@@ -127,6 +125,9 @@ class EditableSpan extends Component{
|
|
}
|
|
}
|
|
handleKeyup(e){
|
|
handleKeyup(e){
|
|
const {boxMark,handleKeydown,i,value} = this.props;
|
|
const {boxMark,handleKeydown,i,value} = this.props;
|
|
|
|
+ const {preVal,index} = this.state;//console.log(22,i,index);
|
|
|
|
+ let innerVal = e.target.innerText;
|
|
|
|
+ if(e.keyCode==8){
|
|
const {preVal,index} = this.state;
|
|
const {preVal,index} = this.state;
|
|
const ev = e||window.event;
|
|
const ev = e||window.event;
|
|
const target = ev.target||ev.srcElement;
|
|
const target = ev.target||ev.srcElement;
|
|
@@ -140,7 +141,8 @@ class EditableSpan extends Component{
|
|
if(index!==0 && pattern.test(data)){
|
|
if(index!==0 && pattern.test(data)){
|
|
handleKeydown&&handleKeydown({boxMark,i:index});
|
|
handleKeydown&&handleKeydown({boxMark,i:index});
|
|
this.setState({
|
|
this.setState({
|
|
- index:index-1
|
|
|
|
|
|
+ // index:index-1 //连续往前删除,体验不佳
|
|
|
|
+ index:null
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|