Skip to content

Commit

Permalink
Use ClipboardJS latest version and clean up focus loss workaround. (#…
Browse files Browse the repository at this point in the history
…57156)

Co-authored-by: Carolina Nymark <[email protected]>
  • Loading branch information
afercia and carolinan authored Jan 17, 2024
1 parent b77d9f4 commit e1598cf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
46 changes: 24 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/compose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@wordpress/priority-queue": "file:../priority-queue",
"@wordpress/undo-manager": "file:../undo-manager",
"change-case": "^4.1.2",
"clipboard": "^2.0.8",
"clipboard": "^2.0.11",
"mousetrap": "^1.6.5",
"use-memo-one": "^1.1.1"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/compose/src/hooks/use-copy-to-clipboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ export default function useCopyToClipboard( text, onSuccess ) {
// button, ensuring that it is not reset to the body, and
// further that it is kept within the rendered node.
clearSelection();
// Handle ClipboardJS focus bug, see
// https://github.com/zenorocha/clipboard.js/issues/680
node.focus();

if ( onSuccessRef.current ) {
onSuccessRef.current();
Expand Down

0 comments on commit e1598cf

Please sign in to comment.