Fix content clipcopy

This commit is contained in:
Jonatan Kłosko 2023-05-30 11:15:31 +02:00
parent 6b139c95ce
commit 1e7b111c64

View file

@ -49,12 +49,10 @@ export function registerGlobalEventHandlers() {
window.addEventListener("lb:clipcopy", (event) => {
if ("clipboard" in navigator) {
const tag = event.target.tagName;
if (tag === "INPUT") {
if (event.target.tagName === "INPUT") {
navigator.clipboard.writeText(event.target.value);
} else {
navigator.clipboard.writeText(event.target.tagName);
navigator.clipboard.writeText(event.target.textContent);
}
} else {
alert(