Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

How to change the shape and text of a Clipboard component?

$
0
0

Hello all, Happy new year!

I need to make a Clipboard component look different. Specifically I need to make it look like a Button that includes the text “Copy Data”.

I don’t see any properties for the Clipboard that enable me to change it this way. I’ve tried to use javascript’s appendChild() to inject HTML into the top-level div for the Clipboard but I ran into a timing problem. That is, when my code below runs the window is loaded but React has yet to embed thediv in the DOM and my_clipboard is null).

window.addEventListener('load', function(event) {
  let my_clipboard = document.getElementById("my-clipboard");
  let text = document.createTextNode("Copy Data");
  my_clipboard.appendChild(text);
});

Might anyone be able to help me with my timing issue or suggest a different approach to change how the Clipboard component looks?

Thanks,
urig

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles