mirror of
https://github.com/docusealco/docuseal
synced 2026-11-12 23:42:33 -05:00
show alert when copy to clipboard not https
This commit is contained in:
1 parent
3cceaf5cc7
commit
cd42d031e4
1 file changed
+9
-1
@@ -5,7 +5,15 @@ export default class extends HTMLElement {
|
|||||||
this.addEventListener('click', (e) => {
|
this.addEventListener('click', (e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
|
||||||
navigator.clipboard.writeText(this.dataset.text || this.innerText.trim())
|
const text = this.dataset.text || this.innerText.trim()
|
||||||
|
|
||||||
|
if (navigator.clipboard) {
|
||||||
|
navigator.clipboard.writeText(text)
|
||||||
|
} else {
|
||||||
|
if (e.target.tagName !== 'INPUT') {
|
||||||
|
alert(`Clipboard not available. Make sure you're using https://\nCopy text: ${text}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user