mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Work around incorrect data on compositionupdate events in Chrome 56
This commit is contained in:
@@ -1651,7 +1651,14 @@ class TextEditorComponent {
|
||||
}
|
||||
|
||||
didCompositionUpdate (event) {
|
||||
this.props.model.insertText(event.data, {select: true})
|
||||
if (parseInt(process.versions.chrome) === 56) {
|
||||
process.nextTick(() => {
|
||||
const previewText = this.refs.cursorsAndInput.refs.hiddenInput.value
|
||||
this.props.model.insertText(previewText, {select: true})
|
||||
})
|
||||
} else {
|
||||
this.props.model.insertText(event.data, {select: true})
|
||||
}
|
||||
}
|
||||
|
||||
didCompositionEnd (event) {
|
||||
|
||||
Reference in New Issue
Block a user