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/12482

Vanessa75edefb000e4
diff --git a/app/src/asset/pdf/app.js b/app/src/asset/pdf/app.js
index 29a9fa75c8..860425a052 100644
--- a/app/src/asset/pdf/app.js
+++ b/app/src/asset/pdf/app.js
@@ -90,7 +90,7 @@ import {Toolbar} from "./toolbar";
import {ViewHistory} from "./view_history.js";
import {hasClosestByClassName} from "../../protyle/util/hasClosest";
import {Constants} from "../../constants";
-import {getPdfInstance} from "../anno";
+import {getPdfInstance, hlPDFRect} from "../anno";
const FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms
@@ -2469,7 +2469,10 @@ function onPageNumberChanged(evt) {
if (evt.value !== "") {
it.pdfLinkService.goToPage(evt.value);
}
-
+ // NOTE
+ if (evt.id) {
+ hlPDFRect(it.pdfViewer.container, evt.id)
+ }
// Ensure that the page number input displays the correct value, even if the
// value entered by the user was invalid (e.g. a floating point number).
if (
@@ -2815,7 +2818,9 @@ function onKeyUp(evt) {
return
}
// NOTE 4+ 版本不知道为 r 后不 focus 了
- pdfInstance.pdfViewer.focus();
+ if (!["SELECT", "TEXTAREA", "INPUT"].includes(evt.target.tagName)) {
+ pdfInstance.pdfViewer.focus();
+ }
// evt.ctrlKey is false hence we use evt.key.
if (evt.key === "Control") {
diff --git a/app/src/assets/scss/pdf/_pdf.scss b/app/src/assets/scss/pdf/_pdf.scss
index 68cfcb7f98..3ffe1ba11f 100644
--- a/app/src/assets/scss/pdf/_pdf.scss
+++ b/app/src/assets/scss/pdf/_pdf.scss
@@ -371,6 +371,7 @@
margin-right: 8px;
color: var(--b3-theme-on-surface);
overflow: initial;
+ align-self: center;
&:hover,
&:focus {
@@ -412,6 +413,7 @@
width: inherit;
min-width: auto;
padding: 0 8px;
+ height: 26px;
}
}