Skip to content

Commit ef0c4f8

Browse files
authored
fix(useClipboard): add readonly attribute to textarea fallback to support Safari 15 (#5179)
1 parent bc4aca9 commit ef0c4f8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/core/useClipboard/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export function useClipboard(options: UseClipboardOptions<MaybeRefOrGetter<strin
114114
ta.value = value
115115
ta.style.position = 'absolute'
116116
ta.style.opacity = '0'
117+
ta.setAttribute('readonly', '')
117118
document.body.appendChild(ta)
118119
ta.select()
119120
document.execCommand('copy')

0 commit comments

Comments
 (0)