better naming
This commit is contained in:
parent
9f47fad305
commit
7bda1c58eb
3 changed files with 5 additions and 5 deletions
|
@ -173,12 +173,12 @@ export default class BasicMessageEditor extends React.Component {
|
||||||
// so trigger a model update after the composition is done by calling the input handler.
|
// 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.
|
// do this async though, as modifying the DOM from the compositionend event might confuse the composition.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this._onInput({inputType: "insertCompositionText"});
|
this._onInput({inputType: "insertCompositionText"}, true);
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldIgnoreKeyDownEvents() {
|
isComposing(event) {
|
||||||
return this._isIMEComposing;
|
return !!(this._isIMEComposing || event.isComposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPaste = (event) => {
|
_onPaste = (event) => {
|
||||||
|
|
|
@ -127,7 +127,7 @@ export default class EditMessageComposer extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onKeyDown = (event) => {
|
_onKeyDown = (event) => {
|
||||||
if (this._editorRef.shouldIgnoreKeyDownEvents()) {
|
if (this._editorRef.isComposing(event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.metaKey || event.altKey || event.shiftKey) {
|
if (event.metaKey || event.altKey || event.shiftKey) {
|
||||||
|
|
|
@ -104,7 +104,7 @@ export default class SendMessageComposer extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
_onKeyDown = (event) => {
|
_onKeyDown = (event) => {
|
||||||
if (this._editorRef.shouldIgnoreKeyDownEvents()) {
|
if (this._editorRef.isComposing(event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hasModifier = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
|
const hasModifier = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue