fix: stop event propagation on task header button clicks (#7139)
Prevent default actions and stop event propagation on button clicks to avoid unintended behavior.
This commit is contained in:
3 files changed
+19
-3
No files matched your search
@@ -25,7 +25,15 @@ const CopyTaskButton: React.FC<{
|
||||
<Tooltip>
|
||||
<TooltipContent side="bottom">Copy Text</TooltipContent>
|
||||
<TooltipTrigger className={cn("flex items-center", className)}>
|
||||
<Button aria-label="Copy" onClick={() => handleCopy()} size="icon" variant="icon">
|
||||
<Button
|
||||
aria-label="Copy"
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
handleCopy()
|
||||
}}
|
||||
size="icon"
|
||||
variant="icon">
|
||||
{copied ? <CheckIcon /> : <CopyIcon />}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
|
||||
@@ -17,7 +17,11 @@ const DeleteTaskButton: React.FC<{
|
||||
<Button
|
||||
aria-label="Delete Task"
|
||||
disabled={!taskId}
|
||||
onClick={() => taskId && TaskServiceClient.deleteTasksWithIds(StringArrayRequest.create({ value: [taskId] }))}
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
taskId && TaskServiceClient.deleteTasksWithIds(StringArrayRequest.create({ value: [taskId] }))
|
||||
}}
|
||||
size="xs"
|
||||
variant="icon">
|
||||
<TrashIcon />
|
||||
|
||||
+5
-1
@@ -25,7 +25,11 @@ const OpenDiskConversationHistoryButton: React.FC<{
|
||||
<TooltipTrigger className={cn("flex items-center", className)}>
|
||||
<Button
|
||||
aria-label="Open Disk Conversation History"
|
||||
onClick={() => handleOpenDiskConversationHistory()}
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
handleOpenDiskConversationHistory()
|
||||
}}
|
||||
size="icon"
|
||||
variant="icon">
|
||||
<ArrowDownToLineIcon />
|
||||
|
||||
Reference in new issue
Block a user