fix: copy button position when overflow

This commit is contained in:
Timothy Lin
2021-06-02 21:47:13 +08:00
parent 66d6c62fe8
commit f1ac747da6
2 changed files with 5 additions and 4 deletions

View File

@ -21,7 +21,7 @@ const Pre = (props) => {
}
return (
<pre ref={textInput} onMouseEnter={onEnter} onMouseLeave={onExit} className="relative">
<div ref={textInput} onMouseEnter={onEnter} onMouseLeave={onExit} className="relative">
{hovered && (
<button
aria-label="Copy code"
@ -62,8 +62,9 @@ const Pre = (props) => {
</svg>
</button>
)}
{props.children}
</pre>
<pre>{props.children}</pre>
</div>
)
}