We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6daf21 commit a54c4b4Copy full SHA for a54c4b4
packages/core/useClipboard/index.ts
@@ -70,13 +70,11 @@ export function useClipboard(options: UseClipboardOptions<MaybeRefOrGetter<strin
70
const copied = shallowRef(false)
71
const timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false })
72
73
- function updateText() {
+ async function updateText() {
74
let useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value))
75
if (!useLegacy) {
76
try {
77
- navigator!.clipboard.readText().then((value) => {
78
- text.value = value
79
- })
+ text.value = await navigator!.clipboard.readText()
80
}
81
catch {
82
useLegacy = true
0 commit comments