Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TDOPS-4851): No copied message when switching back #4825

Merged
merged 9 commits into from
Aug 4, 2023
5 changes: 5 additions & 0 deletions .changeset/pretty-yaks-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-system': patch
---

Form.Copy - Fix no copied message after switching back
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@
}
return '';
};

const doCopy = () => {
const value = inputRef.current?.value || '';

Check warning on line 67 in packages/design-system/src/components/Form/Field/Input/Input.Copy.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/design-system/src/components/Form/Field/Input/Input.Copy.tsx#L67

[@typescript-eslint/no-shadow] 'value' is already declared in the upper scope on line 24 column 4.
copyToClipboard(value);
setCopiedValue(value);
};
return (
<FieldPrimitive
label={label}
Expand All @@ -83,7 +87,7 @@
suffix={{
type: 'button',
icon: 'talend-files-o',
onClick: () => copyToClipboard(inputRef.current?.value || ''),
onClick: doCopy,
disabled: !!disabled || !!readOnly,
children: t('FORM_COPY_COPY_TO_CLIPBOARD', 'Copy to clipboard'),
hideText: true,
Expand Down
Loading