You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Fix ctrl+a, backspace toggling block format
Now it will delete the selected range (and not toggle the block format). Fixes vector-im/riot-web#4753
This commit is contained in:
@@ -519,7 +519,8 @@ export default class MessageComposerInput extends React.Component {
|
|||||||
newState = RichUtils.toggleInlineStyle(this.state.editorState, 'STRIKETHROUGH');
|
newState = RichUtils.toggleInlineStyle(this.state.editorState, 'STRIKETHROUGH');
|
||||||
} else if (shouldToggleBlockFormat) {
|
} else if (shouldToggleBlockFormat) {
|
||||||
const currentStartOffset = this.state.editorState.getSelection().getStartOffset();
|
const currentStartOffset = this.state.editorState.getSelection().getStartOffset();
|
||||||
if (currentStartOffset === 0) {
|
const currentEndOffset = this.state.editorState.getSelection().getEndOffset();
|
||||||
|
if (currentStartOffset === 0 && currentEndOffset === 0) {
|
||||||
// Toggle current block type (setting it to 'unstyled')
|
// Toggle current block type (setting it to 'unstyled')
|
||||||
newState = RichUtils.toggleBlockType(this.state.editorState, currentBlockType);
|
newState = RichUtils.toggleBlockType(this.state.editorState, currentBlockType);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user