You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-20 16:22:28 +03:00
exit list more sanely on backspace
This commit is contained in:
@@ -572,8 +572,9 @@ export default class MessageComposerInput extends React.Component {
|
||||
if (this.state.isRichtextEnabled) {
|
||||
// let backspace exit lists
|
||||
const isList = this.hasBlock('list-item');
|
||||
if (isList) {
|
||||
const change = this.state.editorState.change();
|
||||
const { editorState } = this.state;
|
||||
if (isList && editorState.anchorOffset == 0) {
|
||||
const change = editorState.change();
|
||||
change
|
||||
.setBlocks(DEFAULT_NODE)
|
||||
.unwrapBlock('bulleted-list')
|
||||
|
||||
Reference in New Issue
Block a user