mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
Merge branch 'fix/clipboard' of github.com:toeverything/AFFiNE into fix/clipboard
This commit is contained in:
@@ -1052,17 +1052,15 @@ export class SelectionManager implements VirgoSelection {
|
||||
/**
|
||||
*
|
||||
* move active selection to the new position
|
||||
* @param index:number
|
||||
* @param {number} index
|
||||
* @param {string} blockId
|
||||
* @memberof SelectionManager
|
||||
*/
|
||||
public moveCursor(index: number, blockId: string): void {
|
||||
const now_range = window.getSelection().getRangeAt(0);
|
||||
const nowRange = window.getSelection().getRangeAt(0);
|
||||
let preRang = document.createRange();
|
||||
preRang.setStart(
|
||||
now_range.startContainer,
|
||||
now_range.startOffset + index
|
||||
);
|
||||
preRang.setEnd(now_range.endContainer, now_range.endOffset + index);
|
||||
preRang.setStart(nowRange.startContainer, nowRange.startOffset + index);
|
||||
preRang.setEnd(nowRange.endContainer, nowRange.endOffset + index);
|
||||
let prePosition = preRang.getClientRects().item(0);
|
||||
this.activeNodeByNodeId(
|
||||
blockId,
|
||||
|
||||
Reference in New Issue
Block a user