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

feat(typograph): add text field for Editconfig #37761

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

zheeeng
Copy link
Contributor

@zheeeng zheeeng commented Sep 27, 2022

[中文版模板 / Chinese template]

🤔 This is a ...

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

🔗 Related issue link

💡 Background and solution

When we enable the ellipsis and editable features at the same time, the editing text implicitly uses the passed children as the editing content. As the ellipsis usage required, this children element(string type) should omit the suffix part and specify it to ellipsis, this causes when we enter the editing mode the value of the textarea has no this suffix part.

I think we could use the children as the showing content as the old way, and provide a config text to set the editing content explicitly. Then we can edit the full content of the Typograph and see them with an ellipsis.

📝 Changelog

Language Changelog
🇺🇸 English Add text config for editable Typograph, support enabling ellipsis and editable at the same time
🇨🇳 Chinese Typograph 增加 text 配置,支持同时开启省略与编辑模式时的使用

☑️ 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
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Sorry, something went wrong.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2022

@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (8950fae) compared to base (3a89998).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #37761   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          444       444           
  Lines         8236      8238    +2     
  Branches      2439      2442    +3     
=========================================
+ Hits          8236      8238    +2     
Impacted Files Coverage Δ
components/typography/Base/index.tsx 100.00% <100.00%> (ø)
components/typography/Editable.tsx 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@afc163
Copy link
Member

afc163 commented Sep 27, 2022

基于 feature branch

@afc163
Copy link
Member

afc163 commented Sep 27, 2022

As the ellipsis usage required, this children element(string type) should omit the suffix part and specify it to ellipsis, this causes when we enter the editing mode the value of the textarea has no this suffix part.

提供一个 codesandbox ?

@zheeeng
Copy link
Contributor Author

zheeeng commented Sep 27, 2022

切换到编辑模式,只能编辑去掉 suffix 的部分,实际场景更需要编辑状态下编辑完整的 text,切出编辑状态显示省略的点点点

https://codesandbox.io/s/demo-48c1jo

@zheeeng zheeeng changed the title Feat editconfig.text feat: add text field for Editconfig Sep 29, 2022
@zheeeng zheeeng changed the base branch from master to feature September 30, 2022 03:15
@zheeeng zheeeng changed the title feat: add text field for Editconfig feat(typograph): add text field for Editconfig Sep 30, 2022
@afc163
Copy link
Member

afc163 commented Oct 8, 2022

rebase 要 push --force

@zheeeng
Copy link
Contributor Author

zheeeng commented Oct 8, 2022

rebase 要 push --force

Merge 的

@zheeeng zheeeng force-pushed the feat-editconfig.text branch from cb78e4d to 8950fae Compare October 10, 2022 01:42
@afc163 afc163 merged commit d96ec8a into ant-design:feature Oct 17, 2022
@MadCcc MadCcc mentioned this pull request Oct 19, 2022
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants