Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/7174

Vanessab6e638a77a6d
diff --git a/app/src/assets/scss/_toolbar.scss b/app/src/assets/scss/_toolbar.scss
index 7f8333ac60..9d3b1440fb 100644
--- a/app/src/assets/scss/_toolbar.scss
+++ b/app/src/assets/scss/_toolbar.scss
@@ -64,7 +64,7 @@
background-color: var(--b3-menu-background);
padding: 8px;
max-height: 80vh;
- z-index: 200;
+ z-index: 4;
}
&-font {
diff --git a/app/src/assets/scss/base.scss b/app/src/assets/scss/base.scss
index 4ed2d99d6b..2527f11e5f 100644
--- a/app/src/assets/scss/base.scss
+++ b/app/src/assets/scss/base.scss
@@ -31,12 +31,13 @@
/*
.status: 2
+// 需小于 .block__popover
+// 需小于 ctrl+p https://github.com/siyuan-note/siyuan/issues/7174
+.protyle-util: 4
+
// 需小于 .block__popover https://github.com/siyuan-note/siyuan/issues/3515
ctrl+p 搜索: 199
-// 需小于 .block__popover
-.protyle-util: 200
-
// 引用提示需小于 .block__popover
.protyle-hint: 201
diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.ts
index a541474a9a..fd1b4aa0de 100644
--- a/app/src/protyle/toolbar/Font.ts
+++ b/app/src/protyle/toolbar/Font.ts
@@ -1,7 +1,7 @@
import {getEventName, setStorageVal, updateHotkeyTip} from "../util/compatibility";
import {ToolbarItem} from "./ToolbarItem";
import {setPosition} from "../../util/setPosition";
-import {getSelectionPosition} from "../util/selection";
+import {focusByRange, getSelectionPosition} from "../util/selection";
import {Constants} from "../../constants";
import {hasClosestByAttribute} from "../util/hasClosest";
@@ -21,13 +21,14 @@ export class Font extends ToolbarItem {
protyle.toolbar.subElement.append(fontMenu(protyle));
protyle.toolbar.subElement.classList.remove("fn__none");
protyle.toolbar.subElementCloseCB = undefined;
+ focusByRange(protyle.toolbar.range);
const position = getSelectionPosition(protyle.wysiwyg.element, protyle.toolbar.range);
setPosition(protyle.toolbar.subElement, position.left, position.top + 18, 26);
});
}
}
-export const fontMenu = (protyle: IProtyle) => {
+const fontMenu = (protyle: IProtyle) => {
let colorHTML = "";
["var(--b3-font-color1)", "var(--b3-font-color2)", "var(--b3-font-color3)", "var(--b3-font-color4)",
"var(--b3-font-color5)", "var(--b3-font-color6)", "var(--b3-font-color7)", "var(--b3-font-color8)",
@@ -97,7 +98,7 @@ export const fontMenu = (protyle: IProtyle) => {
</div>
<div style="margin: 4px 0 2px">${window.siyuan.languages.fontSize}</div>
<div class="fn__flex">
- <select class="b3-select">
+ <select class="b3-select fn__block">
<option ${fontSize === "12px" ? "selected" : ""} value="12px">12px</option>
<option ${fontSize === "13px" ? "selected" : ""} value="13px">13px</option>
<option ${fontSize === "14px" ? "selected" : ""} value="14px">14px</option>