@@ -1255,16 +1255,14 @@ export default class MessageComposerInput extends React.Component {
1255
1255
1256
1256
let editorState ;
1257
1257
const historyItem = this . historyManager . getItem ( delta ) ;
1258
- if ( historyItem ) {
1259
- if ( historyItem . format === 'rich' && ! this . state . isRichTextEnabled ) {
1260
- editorState = this . richToMdEditorState ( historyItem . value ) ;
1261
- }
1262
- else if ( historyItem . format === 'markdown' && this . state . isRichTextEnabled ) {
1263
- editorState = this . mdToRichEditorState ( historyItem . value ) ;
1264
- }
1265
- else {
1266
- editorState = historyItem . value ;
1267
- }
1258
+ if ( ! historyItem ) return ;
1259
+
1260
+ if ( historyItem . format === 'rich' && ! this . state . isRichTextEnabled ) {
1261
+ editorState = this . richToMdEditorState ( historyItem . value ) ;
1262
+ } else if ( historyItem . format === 'markdown' && this . state . isRichTextEnabled ) {
1263
+ editorState = this . mdToRichEditorState ( historyItem . value ) ;
1264
+ } else {
1265
+ editorState = historyItem . value ;
1268
1266
}
1269
1267
1270
1268
// Move selection to the end of the selected history
@@ -1544,18 +1542,6 @@ export default class MessageComposerInput extends React.Component {
1544
1542
this . handleKeyCommand ( 'toggle-mode' ) ;
1545
1543
} ;
1546
1544
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
-
1559
1545
focusComposer = ( ) => {
1560
1546
this . refs . editor . focus ( ) ;
1561
1547
} ;
@@ -1601,8 +1587,6 @@ export default class MessageComposerInput extends React.Component {
1601
1587
onChange = { this . onChange }
1602
1588
onKeyDown = { this . onKeyDown }
1603
1589
onPaste = { this . onPaste }
1604
- onBlur = { this . onBlur }
1605
- onFocus = { this . onFocus }
1606
1590
renderNode = { this . renderNode }
1607
1591
renderMark = { this . renderMark }
1608
1592
// disable spell check for the placeholder because browsers don't like "unencrypted"
0 commit comments