File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 25
25
let copiedButton: HTMLSpanElement
26
26
27
27
const copyText = () => {
28
- const text = copyButton .parentElement ?.previousSibling ?.textContent ?.trim ()
29
- || (copyButton .parentElement ?.previousSibling as Text )?.wholeText ?.trim ()
30
- || copyButton .parentElement ?.previousElementSibling ?.textContent ?.trim ()
28
+ const text = copyButton
29
+ .parentElement
30
+ ?.parentElement
31
+ ?.querySelector (' [data-id="text"]' )
32
+ ?.textContent ?.trim ()
31
33
32
34
copyButton .style .opacity = ' 0'
33
35
copyButton .style .pointerEvents = ' none'
45
47
data-tooltip ={tooltip || undefined }
46
48
data-position ={tooltipPosition }
47
49
>
48
- <slot />
50
+ <span data-id = " text " >< slot /></ span >
49
51
<div class ={styles .icons }>
50
52
<button
51
53
class ={styles [' copy-icon' ]}
You can’t perform that action at this time.
0 commit comments