Skip to content

Commit ceff0e2

Browse files
committed
fix: make copyListener async
1 parent 6dffe99 commit ceff0e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/datatip-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,11 @@ export class DataTipManager {
535535

536536
// TODO we should not need this
537537
/** A manual copy listener */
538-
function copyListener(event: KeyboardEvent) {
538+
async function copyListener(event: KeyboardEvent) {
539539
event.preventDefault()
540540
if (event.ctrlKey && event.key === "c") {
541541
const text = document.getSelection()?.toString() ?? ""
542-
navigator.clipboard.writeText(text).catch(() => {})
542+
await navigator.clipboard.writeText(text)
543543
}
544544
}
545545

0 commit comments

Comments
 (0)