fix(workspace): remove bullet placeholder and delete indented bullets directly on backspace
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 51s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 51s
This commit is contained in:
1 parent
d49ef7971d
commit
9b21fd92e1
1 file changed
+5
-6
@@ -813,12 +813,13 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
|||||||
indentBlock(index);
|
indentBlock(index);
|
||||||
}
|
}
|
||||||
} else if (e.key === 'Backspace' && (!block.content || block.content === '')) {
|
} else if (e.key === 'Backspace' && (!block.content || block.content === '')) {
|
||||||
if ((block.level || 0) > 0) {
|
if (selectedDoc?.blocks && selectedDoc.blocks.length > 1) {
|
||||||
|
e.preventDefault();
|
||||||
|
setSlashBlockId(null);
|
||||||
|
deleteBlockAndFocusPrev(index);
|
||||||
|
} else if ((block.level || 0) > 0) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
outdentBlock(block.id);
|
outdentBlock(block.id);
|
||||||
} else if (selectedDoc?.blocks && selectedDoc.blocks.length > 1) {
|
|
||||||
e.preventDefault();
|
|
||||||
deleteBlockAndFocusPrev(index);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1857,7 +1858,6 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
placeholder="Bullet-Titel bearbeiten… (Enter für Unterpunkt)"
|
|
||||||
className="w-full bg-transparent text-xl font-bold text-main focus:outline-none placeholder:text-faint"
|
className="w-full bg-transparent text-xl font-bold text-main focus:outline-none placeholder:text-faint"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -2199,7 +2199,6 @@ export const WorkspaceView: React.FC<WorkspaceViewProps> = ({
|
|||||||
onBlur={() => resetIdleTimer()}
|
onBlur={() => resetIdleTimer()}
|
||||||
onChange={(e) => handleContentChange(block, e.target.value)}
|
onChange={(e) => handleContentChange(block, e.target.value)}
|
||||||
onKeyDown={(e) => handleKeyDown(e, block, originalIndex)}
|
onKeyDown={(e) => handleKeyDown(e, block, originalIndex)}
|
||||||
placeholder={isReadOnly ? '' : 'Gedanke schreiben… (/ für Menü, Tab zum Einrücken)'}
|
|
||||||
className={`w-full bg-transparent text-sm text-main leading-relaxed focus:outline-none resize-none placeholder:text-faint ${
|
className={`w-full bg-transparent text-sm text-main leading-relaxed focus:outline-none resize-none placeholder:text-faint ${
|
||||||
isReadOnly ? 'cursor-default' : ''
|
isReadOnly ? 'cursor-default' : ''
|
||||||
}`}
|
}`}
|
||||||
|
|||||||
Reference in new issue
Block a user