Skip to content

Commit 258c923

Browse files
committed
Workaround to prevent losing text on composing characters
1 parent 5c4d538 commit 258c923

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/input/TextareaInput.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ TextareaInput.prototype = copyObj({
153153
minimal = hasCopyEvent &&
154154
(range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)
155155
let content = minimal ? "-" : selected || cm.getSelection()
156-
this.textarea.value = content
156+
if(!this.composing) this.textarea.value = content
157157
if (cm.state.focused) selectInput(this.textarea)
158158
if (ie && ie_version >= 9) this.hasSelection = content
159159
} else if (!typing) {
160-
this.prevInput = this.textarea.value = ""
160+
if(!this.composing) this.prevInput = this.textarea.value = ""
161161
if (ie && ie_version >= 9) this.hasSelection = null
162162
}
163163
this.inaccurateSelection = minimal

0 commit comments

Comments
 (0)