mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-19 16:40:48 +00:00
fix(ui): prevent copy buttons from stealing focus from prompt input (#10084)
This commit is contained in:
parent
32f72f49a8
commit
3c7d5174b3
2 changed files with 3 additions and 0 deletions
|
|
@ -425,6 +425,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp
|
|||
<IconButton
|
||||
icon={copied() ? "check" : "copy"}
|
||||
variant="secondary"
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={(event) => {
|
||||
event.stopPropagation()
|
||||
handleCopy()
|
||||
|
|
@ -701,6 +702,7 @@ PART_MAPPING["text"] = function TextPartDisplay(props) {
|
|||
<IconButton
|
||||
icon={copied() ? "check" : "copy"}
|
||||
variant="secondary"
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={handleCopy}
|
||||
aria-label={copied() ? i18n.t("ui.message.copied") : i18n.t("ui.message.copy")}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -626,6 +626,7 @@ export function SessionTurn(
|
|||
<IconButton
|
||||
icon={copied() ? "check" : "copy"}
|
||||
variant="secondary"
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={(event) => {
|
||||
event.stopPropagation()
|
||||
handleCopy()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue