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(module:typography): fix copy #2118

Merged
merged 3 commits into from
Nov 21, 2021

Conversation

anranruye
Copy link
Member

@anranruye anranruye commented Nov 17, 2021

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

Fixes #1981

💡 Background and solution

Background:

  1. element inner html string is copied, rather than a human-readable text.
  2. the copy feature doesn't work for old browsers(such as IE)

Solution:

  1. copy text rather than html. try to copy the element content as rich-text at first. if failed, copy the element innerText instead.
  2. click event doesn't work on <svg> element for ie. add "pointer-events:none" css attribute to the svg element to trigger the click event of the parent <a> element. this also fix OnClick event for Icon component.

📝 Changelog

Language Changelog
🇺🇸 English typography: copy content as text rather than html, fix copy feature for ie; icon: fix OnClick event for ie
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link

github-actions bot commented Nov 17, 2021

@codecov
Copy link

codecov bot commented Nov 20, 2021

Codecov Report

Merging #2118 (705afaf) into master (283b616) will increase coverage by 1.99%.
The diff coverage is 4.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2118      +/-   ##
==========================================
+ Coverage   27.88%   29.87%   +1.99%     
==========================================
  Files         492      515      +23     
  Lines       32528    24777    -7751     
  Branches        0      242     +242     
==========================================
- Hits         9070     7403    -1667     
+ Misses      23458    17338    -6120     
- Partials        0       36      +36     
Impacted Files Coverage Δ
components/core/JsInterop/JSInteropConstants.cs 28.81% <0.00%> (-0.50%) ⬇️
...s/core/JsInterop/modules/dom/manipulationHelper.ts 4.87% <0.00%> (ø)
components/typography/TypographyBase.cs 31.03% <0.00%> (+2.08%) ⬆️
components/icon/IconService.cs 55.00% <100.00%> (-0.89%) ⬇️
components/core/Helpers/MemberPath/PathNode.cs 46.15% <0.00%> (-8.85%) ⬇️
components/core/Reflection/TypeDefined.cs 77.77% <0.00%> (-7.94%) ⬇️
components/input/InputGroup.razor.cs 87.50% <0.00%> (-6.95%) ⬇️
...ponents/date-picker/types/DatePickerPlaceholder.cs 22.72% <0.00%> (-4.20%) ⬇️
...ponents/core/Component/Overlay/type/TriggerType.cs 81.25% <0.00%> (-2.97%) ⬇️
components/core/Helpers/DateHelper.cs 80.00% <0.00%> (-2.71%) ⬇️
... and 427 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 283b616...705afaf. Read the comment docs.

@ElderJames ElderJames merged commit 0c794ef into ant-design-blazor:master Nov 21, 2021
@anranruye anranruye deleted the FixTypographyCopy branch December 18, 2021 16:01
ElderJames pushed a commit that referenced this pull request Apr 23, 2022
* fix(module:typography): fix copy

* fix unit tests
ElderJames pushed a commit that referenced this pull request Apr 30, 2022
* fix(module:typography): fix copy

* fix unit tests
ElderJames pushed a commit that referenced this pull request Sep 6, 2022
* fix(module:typography): fix copy

* fix unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paragraph returns a Unicode encoded string when copying Chinese
2 participants