mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-20 02:16:37 +08:00
Fix content clipcopy
This commit is contained in:
parent
6b139c95ce
commit
1e7b111c64
1 changed files with 2 additions and 4 deletions
|
@ -49,12 +49,10 @@ export function registerGlobalEventHandlers() {
|
||||||
|
|
||||||
window.addEventListener("lb:clipcopy", (event) => {
|
window.addEventListener("lb:clipcopy", (event) => {
|
||||||
if ("clipboard" in navigator) {
|
if ("clipboard" in navigator) {
|
||||||
const tag = event.target.tagName;
|
if (event.target.tagName === "INPUT") {
|
||||||
|
|
||||||
if (tag === "INPUT") {
|
|
||||||
navigator.clipboard.writeText(event.target.value);
|
navigator.clipboard.writeText(event.target.value);
|
||||||
} else {
|
} else {
|
||||||
navigator.clipboard.writeText(event.target.tagName);
|
navigator.clipboard.writeText(event.target.textContent);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert(
|
alert(
|
||||||
|
|
Loading…
Add table
Reference in a new issue