Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 265e426

Browse files
committed
remove faulty onBlur/onFocus code which caused selection to rollback
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 020e714 commit 265e426

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/components/views/rooms/MessageComposerInput.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,18 +1544,6 @@ export default class MessageComposerInput extends React.Component {
15441544
this.handleKeyCommand('toggle-mode');
15451545
};
15461546

1547-
onBlur = (e) => {
1548-
this.selection = this.state.editorState.selection;
1549-
};
1550-
1551-
onFocus = (e) => {
1552-
if (this.selection) {
1553-
const change = this.state.editorState.change().select(this.selection);
1554-
this.onChange(change);
1555-
delete this.selection;
1556-
}
1557-
};
1558-
15591547
focusComposer = () => {
15601548
this.refs.editor.focus();
15611549
};
@@ -1601,8 +1589,6 @@ export default class MessageComposerInput extends React.Component {
16011589
onChange={this.onChange}
16021590
onKeyDown={this.onKeyDown}
16031591
onPaste={this.onPaste}
1604-
onBlur={this.onBlur}
1605-
onFocus={this.onFocus}
16061592
renderNode={this.renderNode}
16071593
renderMark={this.renderMark}
16081594
// disable spell check for the placeholder because browsers don't like "unencrypted"

0 commit comments

Comments
 (0)