mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-24 03:09:26 +00:00
fix(client): pin the bash copy button while the command scrolls
The button lived inside the scroll container with sticky/float positioning, so horizontal scrolling dragged it through the command text. It now sits absolutely in a non-scrolling wrapper around the scroller and stays in the corner on both axes.
This commit is contained in:
parent
81db565b9c
commit
b334bdc757
1 changed files with 14 additions and 12 deletions
|
|
@ -164,24 +164,26 @@ export default function BashCall({
|
|||
)}
|
||||
>
|
||||
{command && (
|
||||
<div
|
||||
ref={commandPaneRef}
|
||||
onScroll={onCommandPaneScroll}
|
||||
className="relative max-h-[300px] overflow-auto bg-surface-tertiary dark:bg-gray-950"
|
||||
>
|
||||
<div className="relative bg-surface-tertiary dark:bg-gray-950">
|
||||
<CopyButton
|
||||
iconOnly
|
||||
isCopied={isCopied}
|
||||
onClick={handleCopy}
|
||||
className="sticky right-0 top-1 float-right mr-1.5 mt-1"
|
||||
className="absolute right-1.5 top-1"
|
||||
label={localize('com_ui_copy_code')}
|
||||
/>
|
||||
<pre className="whitespace-pre-wrap break-words px-3 py-2.5 pr-10 font-mono text-xs">
|
||||
<span className="select-none text-text-tertiary" aria-hidden="true">
|
||||
{'$ '}
|
||||
</span>
|
||||
<code className="hljs language-bash">{highlighted ?? command}</code>
|
||||
</pre>
|
||||
<div
|
||||
ref={commandPaneRef}
|
||||
onScroll={onCommandPaneScroll}
|
||||
className="max-h-[300px] overflow-auto"
|
||||
>
|
||||
<pre className="whitespace-pre-wrap break-words px-3 py-2.5 pr-10 font-mono text-xs">
|
||||
<span className="select-none text-text-tertiary" aria-hidden="true">
|
||||
{'$ '}
|
||||
</span>
|
||||
<code className="hljs language-bash">{highlighted ?? command}</code>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<PtcToolTrace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue