mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 22:42:32 -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) => {
|
||||
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