mirror of
https://github.com/readest/readest.git
synced 2026-07-09 16:00:16 +00:00
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
Some checks are pending
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
This commit is contained in:
parent
50cd7f80c6
commit
1d1fbdffdb
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue