mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 10:44:20 +01:00
This commit is contained in:
parent
01223c8110
commit
b4bcae49f2
1 changed files with 2 additions and 1 deletions
|
|
@ -47,6 +47,7 @@ import {saveKeyList, toggleAssetHistory, toggleReplaceHistory, toggleSearchHisto
|
|||
import {highlightById} from "../util/highlightById";
|
||||
import {getSelectionOffset} from "../protyle/util/selection";
|
||||
import {electronUndo} from "../protyle/undo";
|
||||
import {getContenteditableElement} from "../protyle/wysiwyg/getBlock";
|
||||
|
||||
export const openGlobalSearch = (app: App, text: string, replace: boolean, searchData?: Config.IUILayoutTabSearchConfig) => {
|
||||
text = text.trim();
|
||||
|
|
@ -934,7 +935,7 @@ export const openSearchEditor = (options: {
|
|||
const rangeBlockElement = hasClosestBlock(currentRange.startContainer);
|
||||
if (rangeBlockElement) {
|
||||
options.id = rangeBlockElement.getAttribute("data-node-id");
|
||||
const offset = getSelectionOffset(rangeBlockElement, null, options.protyle.highlight.ranges[options.protyle.highlight.rangeIndex]);
|
||||
const offset = getSelectionOffset(getContenteditableElement(rangeBlockElement), null, options.protyle.highlight.ranges[options.protyle.highlight.rangeIndex]);
|
||||
const scrollAttr: IScrollAttr = {
|
||||
rootId: options.protyle.block.rootID,
|
||||
focusId: options.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue