Browse Source

修改医嘱文本问innerHTML,接触回车禁止

zhangxc 6 years ago
parent
commit
5c4f4da57b
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/components/Advice/Textarea/index.jsx

+ 3 - 2
src/components/Advice/Textarea/index.jsx

@@ -36,7 +36,7 @@ class Textarea extends Component {
     //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     // }
     if(next.isRead != isRead && next.value || next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
-      next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
+      next.value ? this.$dom.current.innerHTML = next.value :  this.$dom.current.innerHTML = '' 
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
     if(next.typeConfig != typeConfig) {
@@ -46,7 +46,7 @@ class Textarea extends Component {
   componentDidMount(){
     const {value} = this.props;
     if(value && value.trim()){
-      this.$dom.current.innerText = value
+      this.$dom.current.innerHTML = value
       // this.$dom.current.focus()
       // this.$dom.current.innerText ? (this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
     //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
@@ -62,6 +62,7 @@ class Textarea extends Component {
             ref={this.$dom}
             onInput={this.handleInput}
             onKeyUp={this.handleInput}
+            onkeydown={(e) => {e.stopPropagation()}}
         ></div>
       </div>
     );