fix: fix the row auto selected when copy id
Fix theselected state of the row changed when the id in the row is copied, check the click event target, if the target is the copy button, then stop propagation. Change-Id: I3bc2cd0802d2f7dd08a34c9628d282c9c1a09dd4
This commit is contained in:
parent
b24698f3e2
commit
a17edb45fd
@ -169,10 +169,22 @@ export const getIdRender = (value, copyable = true, isLink = true) => {
|
|||||||
if (!copyable) {
|
if (!copyable) {
|
||||||
return shortRender;
|
return shortRender;
|
||||||
}
|
}
|
||||||
|
const onClick = (e) => {
|
||||||
|
if (e) {
|
||||||
|
const { nodeName = '', className = '' } = e.target || {};
|
||||||
|
const isCopyClick =
|
||||||
|
nodeName === 'svg' ||
|
||||||
|
(isString(className) && className.includes('copy'));
|
||||||
|
if (isCopyClick && e.stopPropagation) {
|
||||||
|
return e.stopPropagation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<Paragraph
|
<Paragraph
|
||||||
copyable={{ text: value }}
|
copyable={{ text: value }}
|
||||||
className={classnames('no-wrap', 'no-margin-bottom')}
|
className={classnames('no-wrap', 'no-margin-bottom')}
|
||||||
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
{shortRender}
|
{shortRender}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
|
Loading…
Reference in New Issue
Block a user