fix: (Typography) renderCopy function has bug when child element is r… #688
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…eact node
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
Fixes #
Changelog
🇨🇳 Chinese
在Typography 组件中,如果要的点击复制文字按钮,复制的文字,如果是ReactNode类型会有bug,案例如下:
解决方法:
我写了一个递归方法,逻辑是如果子元素,如上面的
这个children元素如果不是string或者number,就继续往下找,方法如下(我也是arco design Typography组件的贡献者,这个方法没啥问题,arco也在用):
🇺🇸 English
Fix: fix ...
question:
In the Typography component, if you want to click the copy text icon, the copied text will have bugs if it is a ReactNode type. The case is as follows:
, if the children element is not a string or a number, continue to look down, the method is as follows (I am also arco designContributor of the Typography component, there is nothing wrong with this method, this method arco is also used):