Skip to content

Commit

Permalink
fix: copy paste of text (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard authored Jan 21, 2025
1 parent acec473 commit e334807
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion frontend/src/components/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ const CopyButton = ({ content, className }: Props) => {
</Button>
</TooltipTrigger>
<TooltipContent>
<p>{copied ? t('actions.copy.success') : t('actions.copy.button')}</p>
<p>
{copied
? t('chat.messages.actions.copy.success')
: t('chat.messages.actions.copy.button')}
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/chat/MessageComposer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default function MessageComposer({
const disabled = _disabled || !!attachments.find((a) => !a.uploaded);

const onPaste = useCallback((event: ClipboardEvent) => {
event.preventDefault();
if (event.clipboardData && event.clipboardData.items) {
const items = Array.from(event.clipboardData.items);

Expand All @@ -63,6 +62,8 @@ export default function MessageComposer({
return;
}

event.preventDefault();

// If no text data, check for files (e.g., images)
items.forEach((item) => {
if (item.kind === 'file') {
Expand Down

0 comments on commit e334807

Please sign in to comment.