mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
Merge pull request #198 from toeverything/feature/fix-backspace
Feature/fix backspace
This commit is contained in:
@@ -113,13 +113,18 @@ export const TextView = ({
|
|||||||
block.id,
|
block.id,
|
||||||
'end'
|
'end'
|
||||||
);
|
);
|
||||||
const value = [
|
if (
|
||||||
...preNode.getProperty('text').value,
|
block.getProperty('text').value[0] &&
|
||||||
...block.getProperty('text').value,
|
block.getProperty('text').value[0]?.text !== ''
|
||||||
];
|
) {
|
||||||
await preNode.setProperty('text', {
|
const value = [
|
||||||
value,
|
...preNode.getProperty('text').value,
|
||||||
});
|
...block.getProperty('text').value,
|
||||||
|
];
|
||||||
|
await preNode.setProperty('text', {
|
||||||
|
value,
|
||||||
|
});
|
||||||
|
}
|
||||||
await preNode.append(...children);
|
await preNode.append(...children);
|
||||||
await block.remove();
|
await block.remove();
|
||||||
editor.suspend(false);
|
editor.suspend(false);
|
||||||
|
|||||||
@@ -690,7 +690,7 @@ export class SelectionManager implements VirgoSelection {
|
|||||||
this.emit(nodeId, SelectEventTypes.active, this.lastPoint);
|
this.emit(nodeId, SelectEventTypes.active, this.lastPoint);
|
||||||
// TODO: Optimize the related logic after implementing the scroll bar
|
// TODO: Optimize the related logic after implementing the scroll bar
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this._editor.scrollManager.keepBlockInView(node);
|
this._editor.scrollManager.keepBlockInView(node);
|
||||||
}, this._scrollDelay);
|
}, this._scrollDelay);
|
||||||
} else {
|
} else {
|
||||||
console.warn('Can not find node by this id');
|
console.warn('Can not find node by this id');
|
||||||
|
|||||||
Reference in New Issue
Block a user