File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ export default function TaskDetailDialog({
6666
6767 if ( ! task ) return null
6868
69- const handleCopy = async ( text : string ) => {
69+ const handleCopy = async ( text : string , e ?: React . MouseEvent ) => {
70+ if ( e ) {
71+ e . preventDefault ( )
72+ e . stopPropagation ( )
73+ }
7074 const success = await copyToClipboard ( text )
7175 if ( success ) {
7276 toast . success ( '已复制到剪贴板' )
@@ -127,7 +131,7 @@ export default function TaskDetailDialog({
127131 < Button
128132 variant = "ghost"
129133 size = "sm"
130- onClick = { ( ) => handleCopy ( task . url ) }
134+ onClick = { ( e ) => handleCopy ( task . url , e ) }
131135 >
132136 < Copy className = "h-4 w-4" />
133137 </ Button >
@@ -151,7 +155,7 @@ export default function TaskDetailDialog({
151155 < Button
152156 variant = "ghost"
153157 size = "sm"
154- onClick = { ( ) => handleCopy ( task . file_path || '' ) }
158+ onClick = { ( e ) => handleCopy ( task . file_path || '' , e ) }
155159 title = "复制文件路径"
156160 >
157161 < Copy className = "h-4 w-4" />
@@ -220,7 +224,7 @@ export default function TaskDetailDialog({
220224 < Button
221225 variant = "ghost"
222226 size = "sm"
223- onClick = { ( ) => handleCopy ( file . path ) }
227+ onClick = { ( e ) => handleCopy ( file . path , e ) }
224228 className = "flex-shrink-0"
225229 >
226230 < Copy className = "h-3 w-3" />
You can’t perform that action at this time.
0 commit comments