mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
delay DOM modification after compositionend
This commit is contained in:
parent
86cbaf5b40
commit
4d151722ff
1 changed files with 7 additions and 2 deletions
|
@ -170,8 +170,13 @@ export default class BasicMessageEditor extends React.Component {
|
|||
_onCompositionEnd = (event) => {
|
||||
this._isIMEComposing = false;
|
||||
// some browsers (chromium) don't fire an input event after ending a composition
|
||||
// so trigger a model update after the composition is done by calling the input handler
|
||||
this._onInput({inputType: "insertCompositionText"});
|
||||
// so trigger a model update after the composition is done by calling the input handler.
|
||||
// do this async though, as modifying the DOM from the compositionend event might confuse the composition.
|
||||
setTimeout(() => {
|
||||
this._onInput({inputType: "insertCompositionText"});
|
||||
}, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_onPaste = (event) => {
|
||||
|
|
Loading…
Reference in a new issue