mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
d61ee623f9
commit
6d8b14bbf3
2 changed files with 15 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ import * as dayjs from "dayjs";
|
|||
import {unicode2Emoji} from "../../../emoji";
|
||||
import {focusBlock} from "../../util/selection";
|
||||
import {isMac} from "../../util/compatibility";
|
||||
import {hasClosestByClassName} from "../../util/hasClosest";
|
||||
import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
|
||||
import {stickyRow} from "./row";
|
||||
import {getCalcValue} from "./calc";
|
||||
|
||||
|
|
@ -303,6 +303,16 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
|||
focusBlock(e);
|
||||
}
|
||||
}
|
||||
if (getSelection().rangeCount > 0) {
|
||||
// 修改表头后光标重新定位
|
||||
const range = getSelection().getRangeAt(0)
|
||||
if (!hasClosestByClassName(range.startContainer, "av__title")) {
|
||||
const blockElement = hasClosestBlock(range.startContainer)
|
||||
if (blockElement && e.isSameNode(blockElement)) {
|
||||
focusBlock(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
e.querySelector(".layout-tab-bar").scrollLeft = (e.querySelector(".layout-tab-bar .item--focus") as HTMLElement).offsetLeft;
|
||||
if (cb) {
|
||||
cb();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue