manually attach input event handler, as React doesn't pass inputType
parent
111b28971a
commit
507b89fc61
|
@ -280,6 +280,7 @@ export default class MessageEditor extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
this._editorRef.removeEventListener("input", this._onInput, true);
|
||||||
const sel = document.getSelection();
|
const sel = document.getSelection();
|
||||||
const {caret} = getCaretOffsetAndText(this._editorRef, sel);
|
const {caret} = getCaretOffsetAndText(this._editorRef, sel);
|
||||||
const parts = this.model.serializeParts();
|
const parts = this.model.serializeParts();
|
||||||
|
@ -292,6 +293,9 @@ export default class MessageEditor extends React.Component {
|
||||||
this._updateEditorState();
|
this._updateEditorState();
|
||||||
// initial caret position
|
// initial caret position
|
||||||
this._initializeCaret();
|
this._initializeCaret();
|
||||||
|
// attach input listener by hand so React doesn't proxy the events,
|
||||||
|
// as the proxied event doesn't support inputType, which we need.
|
||||||
|
this._editorRef.addEventListener("input", this._onInput, true);
|
||||||
this._editorRef.focus();
|
this._editorRef.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,7 +363,6 @@ export default class MessageEditor extends React.Component {
|
||||||
className="mx_MessageEditor_editor"
|
className="mx_MessageEditor_editor"
|
||||||
contentEditable="true"
|
contentEditable="true"
|
||||||
tabIndex="1"
|
tabIndex="1"
|
||||||
onInput={this._onInput}
|
|
||||||
onKeyDown={this._onKeyDown}
|
onKeyDown={this._onKeyDown}
|
||||||
ref={ref => this._editorRef = ref}
|
ref={ref => this._editorRef = ref}
|
||||||
aria-label={_t("Edit message")}
|
aria-label={_t("Edit message")}
|
||||||
|
|
Loading…
Reference in New Issue