mirror of https://github.com/vector-im/riot-web
exit list more sanely on backspace
parent
a4d9338cf0
commit
58670cc3e5
|
@ -572,8 +572,9 @@ export default class MessageComposerInput extends React.Component {
|
||||||
if (this.state.isRichtextEnabled) {
|
if (this.state.isRichtextEnabled) {
|
||||||
// let backspace exit lists
|
// let backspace exit lists
|
||||||
const isList = this.hasBlock('list-item');
|
const isList = this.hasBlock('list-item');
|
||||||
if (isList) {
|
const { editorState } = this.state;
|
||||||
const change = this.state.editorState.change();
|
if (isList && editorState.anchorOffset == 0) {
|
||||||
|
const change = editorState.change();
|
||||||
change
|
change
|
||||||
.setBlocks(DEFAULT_NODE)
|
.setBlocks(DEFAULT_NODE)
|
||||||
.unwrapBlock('bulleted-list')
|
.unwrapBlock('bulleted-list')
|
||||||
|
|
Loading…
Reference in New Issue