fix(macOS): delay writing to clipboard to ensure it won't be overridden by system clipboard actions, closes #2647 (#2649)
Some checks are pending
Deploy to vercel on merge / build_and_deploy (push) Waiting to run

This commit is contained in:
Huang Xin 2025-12-08 21:05:27 +08:00 committed by GitHub
parent 50cd7f80c6
commit 1d1fbdffdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;