mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
fix: 无法导出规则分享
This commit is contained in:
@@ -21,6 +21,8 @@ export async function copyToClipboard(content: string) {
|
|||||||
const input = document.createElement('textarea')
|
const input = document.createElement('textarea')
|
||||||
input.value = content
|
input.value = content
|
||||||
document.body.appendChild(input)
|
document.body.appendChild(input)
|
||||||
|
// 阻止事件冒泡到其他元素,确保 focusin 事件只在 textarea 元素上处理,不会影响其他元素
|
||||||
|
input.addEventListener('focusin', e => e.stopPropagation())
|
||||||
input.select()
|
input.select()
|
||||||
document.execCommand('copy')
|
document.execCommand('copy')
|
||||||
document.body.removeChild(input)
|
document.body.removeChild(input)
|
||||||
|
|||||||
Reference in New Issue
Block a user