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

checkbox checked icon is not in the center of the input in selection table #16695

Closed
1 task done
hhshii opened this issue May 21, 2019 · 6 comments · Fixed by #19452
Closed
1 task done

checkbox checked icon is not in the center of the input in selection table #16695

hhshii opened this issue May 21, 2019 · 6 comments · Fixed by #19452
Assignees
Labels

Comments

@hhshii
Copy link

hhshii commented May 21, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

set Table with bordered: true

What is expected?

the icon should be in the center of the input

What is actually happening?

the icon is in the left of the input

Environment Info
antd 3.18.2
React 16.8.6
System MacOS 10.14.3
Browser Chrome 76.0.3795.3 & 76.0.3800.0

Kapture 2019-05-21 at 11 02 37

@MrHeer
Copy link
Contributor

MrHeer commented May 21, 2019

Can we do this:
mixin.less#L64

  top: 50%;
- left: 21%;
+ left: 50%;
  display: table;

mixin.less#L99

  border-left: 0;
- transform: rotate(45deg) scale(1) translate(-50%, -50%);
+ transform: rotate(45deg) scale(1) translate(-100%, -20%);
  opacity: 1;

Preview

@hhshii
Copy link
Author

hhshii commented May 21, 2019

@MrHeer Great! My temporary solution is changing 21% to 22% but it 's too ugly 😂

@MrHeer
Copy link
Contributor

MrHeer commented May 21, 2019

I have tried your solution, I can't see the difference between them. 😂

@zombieJ
Copy link
Member

zombieJ commented May 21, 2019

Seems a Chrome bug with collapsed bordered table. It get check box position as decimal:

$0.getBoundingClientRect()
DOMRect {x: 46.5, y: 164, width: 16, height: 21, top: 164, …}

Change percentage may be not best solution since we've adjust the percentage multiple time ...

@chiaweilee
Copy link
Contributor

chiaweilee commented Oct 28, 2019

Can we do this:
mixin.less#L64

  top: 50%;
- left: 21%;
+ left: 50%;
  display: table;

mixin.less#L99

  border-left: 0;
- transform: rotate(45deg) scale(1) translate(-50%, -50%);
+ transform: rotate(45deg) scale(1) translate(-100%, -20%);
  opacity: 1;

Preview

This works for me.

@afc163
Copy link
Member

afc163 commented Oct 28, 2019

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

Successfully merging a pull request may close this issue.

6 participants