mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 08:21:46 +03:00
Merge branch 'feat/edit' into feat/code
This commit is contained in:
commit
dfb7d8571f
@ -97,6 +97,23 @@ export const TextView = ({
|
|||||||
const onBackspace: TextProps['handleBackSpace'] = editor.withBatch(
|
const onBackspace: TextProps['handleBackSpace'] = editor.withBatch(
|
||||||
async props => {
|
async props => {
|
||||||
const { isCollAndStart } = props;
|
const { isCollAndStart } = props;
|
||||||
|
const activeBlockIds =
|
||||||
|
editor.selectionManager.getSelectedNodesIds();
|
||||||
|
|
||||||
|
// when only one group selected , remove this group block
|
||||||
|
if (activeBlockIds && activeBlockIds.length === 1) {
|
||||||
|
const activeBlock = await editor.getBlockById(
|
||||||
|
activeBlockIds[0]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
activeBlock &&
|
||||||
|
activeBlock.type === Protocol.Block.Type.group
|
||||||
|
) {
|
||||||
|
await activeBlock.remove();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!isCollAndStart) {
|
if (!isCollAndStart) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -406,6 +406,7 @@ export const TextManage = forwardRef<ExtendedTextUtils, CreateTextView>(
|
|||||||
textRef.current.isEmpty() || textRef.current.isSelectAll();
|
textRef.current.isEmpty() || textRef.current.isSelectAll();
|
||||||
|
|
||||||
const ifSelectGroup = await selectGroupBlocks(isSelectAll);
|
const ifSelectGroup = await selectGroupBlocks(isSelectAll);
|
||||||
|
|
||||||
if (ifSelectGroup) {
|
if (ifSelectGroup) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user