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: allow selecting only value on double click on DescriptionsItem #24983

Merged
merged 8 commits into from
Jun 16, 2020

Conversation

harupy
Copy link
Contributor

@harupy harupy commented Jun 14, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

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

🔗 Related issue link

Fix #24977

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 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
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@pr-triage pr-triage bot added the PR: draft label Jun 14, 2020
@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jun 14, 2020

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jun 14, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 14, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 90e827a:

Sandbox Source
antd reproduction template Configuration

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 14, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 434bc71:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Jun 14, 2020

Codecov Report

Merging #24983 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24983   +/-   ##
=======================================
  Coverage   99.37%   99.37%           
=======================================
  Files         365      365           
  Lines        7303     7303           
  Branches     2041     2032    -9     
=======================================
  Hits         7257     7257           
  Misses         46       46           

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 0f46173...434bc71. Read the comment docs.

@harupy harupy marked this pull request as ready for review June 14, 2020 15:06
@Rustin170506
Copy link
Contributor

Rustin170506 commented Jun 15, 2020

The CI broken. Maybe you should run npm test -- -u to update snapshots.

{content && <span className={classNames(`${itemPrefixCls}-item-content`)}>{content}</span>}
{content && (
<span className={classNames(`${itemPrefixCls}-item-content`)}>
<div>{content}</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think put a div into span is a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider other element?

Copy link
Contributor Author

@harupy harupy Jun 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rustin-Liu Thanks for the comment.

I agree. I found a related issue:

https://stackoverflow.com/questions/43690276/text-selection-inside-inline-blocks-without-space-between

The accepted answer suggests inserting an invisible space between span tags:

<span>Lemon2</span><i style="font-size:0;"> </i><span>Pear2</span>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rustin-Liu What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK for me. Thanks!

@afc163
Copy link
Member

afc163 commented Jun 16, 2020

Could we try this?

.ant-descriptions-item>span {
- display: inline-block;
+ display: inline-flex;
+ align-items: baseline;
}

@harupy
Copy link
Contributor Author

harupy commented Jun 16, 2020

@afc163 Got it.

@harupy
Copy link
Contributor Author

harupy commented Jun 16, 2020

@afc163 afc163 merged commit 87875ee into ant-design:master Jun 16, 2020
@harupy harupy deleted the fix-descriptions-item branch June 16, 2020 06:29
@harupy
Copy link
Contributor Author

harupy commented Jun 16, 2020

@Rustin-Liu @afc163 Thanks for the support!

@afc163 afc163 mentioned this pull request Jun 21, 2020
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.

Double-clicking the value of Descriptions.Item selects both label and value
4 participants