forked from akai/readest
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user