Skip to content

Commit 9332330

Browse files
RSS1102tdesign-bot
andauthored
fix(typography): prevent immediate execution of copyable.onCopy during initialization (#4105)
* fix(typography): prevent immediate execution of `onCopy` during initialization * chore: stash changelog [ci skip] --------- Co-authored-by: tdesign-bot <tdesign@tencent.com>
1 parent a7380d4 commit 9332330

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/components/typography/Text.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const Text = forwardRef<HTMLSpanElement, TypographyTextProps>((originalProps, re
8282
}
8383
: {
8484
text: copyable?.text || children?.toString(),
85-
onCopy: copyable?.onCopy?.(),
85+
onCopy: copyable?.onCopy,
8686
tooltipProps: {
8787
...copyable?.tooltipProps,
8888
content: isCopied ? copiedText : copyable?.tooltipProps?.content,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
pr_number: 4105
3+
contributor: RSS1102
4+
---
5+
6+
- fix(typography): 修复 `copyable.onCopy` 在初始化时被立即执行的问题 @RSS1102 ([#4105](https://github.com/Tencent/tdesign-react/pull/4105))

0 commit comments

Comments
 (0)