Skip to content

Commit

Permalink
userNodeId
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Dec 27, 2024
1 parent 6e7bf34 commit cbb9a97
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export default function FeedbackItemUsername({className, feedbackIssue, style}:

const user = name && email && !isSameNameAndEmail ? `${name} <${email}>` : nameOrEmail;

const useNodeId = useId();
const userNodeId = useId();

const handleSelectText = useCallback(() => {
const node = document.getElementById(useNodeId);
const node = document.getElementById(userNodeId);
if (!node) {
return;
}

selectText(node);
}, [useNodeId]);
}, [userNodeId]);

const {onClick: handleCopyToClipboard} = useCopyToClipboard({
text: user ?? '',
Expand All @@ -58,7 +58,7 @@ export default function FeedbackItemUsername({className, feedbackIssue, style}:
<Flex align="center" gap={space(1)} className={className} style={style}>
<Tooltip title={t('Click to copy')} containerDisplayMode="flex">
<Flex
id={useNodeId}
id={userNodeId}
align="center"
wrap="wrap"
gap={space(0.5)}
Expand Down

0 comments on commit cbb9a97

Please sign in to comment.