feat(): disable shift-keydown
This commit is contained in:
parent
f869c63f26
commit
38de981c70
|
@ -50,7 +50,7 @@ import Parser from '../parser';
|
|||
import Language from '../language';
|
||||
import Mark from '../mark';
|
||||
import List from '../list';
|
||||
import { EditorInterface, TypingInterface } from '../types';
|
||||
import { TypingInterface } from '../types';
|
||||
import Typing from '../typing';
|
||||
import Container from './container';
|
||||
import Inline from '../inline';
|
||||
|
|
|
@ -34,6 +34,12 @@ class ShitEnter implements TypingHandleInterface {
|
|||
event.preventDefault();
|
||||
change.cacheRangeBeforeCommand();
|
||||
const range = change.range.get();
|
||||
if (range.startNode.closest('li').length === 0) {
|
||||
this.engine.typing
|
||||
.getHandleListener('enter', 'keydown')
|
||||
?.trigger(event);
|
||||
return;
|
||||
} else {
|
||||
const br = $('<br />');
|
||||
inline.insert(br, range);
|
||||
if (block.isLastOffset(range, 'end')) {
|
||||
|
@ -46,6 +52,8 @@ class ShitEnter implements TypingHandleInterface {
|
|||
range.select(cloneBr).collapse(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.listeners.length; i++) {
|
||||
const listener = this.listeners[i];
|
||||
const result = listener(event);
|
||||
|
|
Loading…
Reference in New Issue