tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
294
fork
atom
a tool for shared writing and social publishing
294
fork
atom
overview
issues
31
pulls
pipelines
fix enter breaking selected state in list item
awarm.space
3 days ago
9e1f686c
71c6bc04
+9
-3
1 changed file
expand all
collapse all
unified
split
components
Blocks
TextBlock
keymap.ts
+9
-3
components/Blocks/TextBlock/keymap.ts
···
392
392
view?: EditorView,
393
393
) => {
394
394
if (state.doc.textContent.startsWith("/")) return true;
395
395
+
// Empty list item: just outdent, don't create a new block
396
396
+
if (
397
397
+
propsRef.current.listData &&
398
398
+
propsRef.current.pageType !== "canvas" &&
399
399
+
state.doc.content.size <= 2
400
400
+
) {
401
401
+
shifttab(propsRef, repRef)();
402
402
+
return true;
403
403
+
}
395
404
let tr = state.tr;
396
405
let newContent = tr.doc.slice(state.selection.anchor);
397
406
tr.delete(state.selection.anchor, state.doc.content.size);
···
451
460
return;
452
461
}
453
462
if (propsRef.current.listData) {
454
454
-
if (state.doc.content.size <= 2) {
455
455
-
return shifttab(propsRef, repRef)();
456
456
-
}
457
463
let createChild =
458
464
propsRef.current.nextBlock?.listData &&
459
465
propsRef.current.nextBlock.listData.depth >