fix(macOS): delay writing to clipboard to ensure it won't be overridden by system clipboard actions, closes #2647 (#2649)

This commit is contained in:
Huang Xin
2025-12-08 21:05:27 +08:00
committed by GitHub
parent 50cd7f80c6
commit 1d1fbdffdb
@@ -384,7 +384,10 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
const handleCopy = (copyToNotebook = true) => {
if (!selection || !selection.text) return;
navigator.clipboard?.writeText(selection.text);
setTimeout(() => {
// Delay to ensure it won't be overridden by system clipboard actions
navigator.clipboard?.writeText(selection.text);
}, 100);
handleDismissPopupAndSelection();
if (!copyToNotebook) return;