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

[Feature Request] Improve Typography copyable #25203

Closed
afc163 opened this issue Jun 24, 2020 · 3 comments · Fixed by #25274
Closed

[Feature Request] Improve Typography copyable #25203

afc163 opened this issue Jun 24, 2020 · 3 comments · Fixed by #25274
Labels
💡 Feature Request help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.

Comments

@afc163
Copy link
Member

afc163 commented Jun 24, 2020

Now we support a copy button with original text: https://codesandbox.io/s/interesting-river-vtoqf?file=/index.js

<Paragraph copyable={{ text: 'Hello, Ant Design!' }} />

There is three problems to resolve:

  1. Cannot customize copy icon.
  2. The copy icon has extra margin-left.
  3. There is no good way to change default Copy and Copied in Tooltip.

image

The new API we are looking for should be:

<Paragraph
  copyable={{
    text: 'Hello, Ant Design!',
    onCopy: () => {},
+   icon: <Icon />,
+   tooltips: ['Copy', 'Copied'],
  }} 
/>
@afc163 afc163 added 💡 Feature Request help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. labels Jun 24, 2020
@ant-design-bot

This comment has been minimized.

@zombieJ
Copy link
Member

zombieJ commented Jun 24, 2020

tooltips is no need. It's controlled by ConfigProvider locale. icon support customize is good enough.

@afc163
Copy link
Member Author

afc163 commented Jun 24, 2020

It is a common need to customize tooltip for each copy button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Feature Request help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants