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

Pagination links with page number should take whole space of the li rectangle #15704

Closed
1 task done
tylik1 opened this issue Mar 28, 2019 · 9 comments · Fixed by #16447
Closed
1 task done

Pagination links with page number should take whole space of the li rectangle #15704

tylik1 opened this issue Mar 28, 2019 · 9 comments · Fixed by #16447

Comments

@tylik1
Copy link

tylik1 commented Mar 28, 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

Open example link and try to click page number, on the rectangle ( not on the number).
See that click is not triggered. Click is only triggered when clicked on the number, because number doesn't take whole space of the li item.

What is expected?

Click on anchor should be triggered when page number rectangle is clicked.

What is actually happening?

Anchor is not clicked

Environment Info
antd 3.15.2
React 16
System osx
Browser Chrome

This is already implemented in next, prev buttons. Anchors take whole li space.
This is especially important when used with real links. e.g. Link from react-router-dom

@tylik1
Copy link
Author

tylik1 commented Mar 28, 2019

It seems that even border needs to be applied to a tag. Styling litag is useless if someone wants to utilize anchor behavior

@ztplz
Copy link
Contributor

ztplz commented Mar 30, 2019

Just take a look at it, but I didn't find the situation you described.
Untitled7
If I am wrong, please correct me.

@ztplz
Copy link
Contributor

ztplz commented Mar 30, 2019

Hmm, sorry, I understand what you mean.

@ztplz
Copy link
Contributor

ztplz commented Mar 30, 2019

@tylik1 Why not use onChange?

@tylik1
Copy link
Author

tylik1 commented Mar 30, 2019

@ztplz because i'm using <Link to="path" /> from react-router-dom
There is no need to use onChange on top of that.

I understand that onChange provides potential workaround, but still think that a should be styled instead of li. It seems more accurate to me.

@ztplz
Copy link
Contributor

ztplz commented Mar 30, 2019

You can set style for a.

style = {{
    display: 'block',
    width: 46,
    height: 32
}}

@ztplz
Copy link
Contributor

ztplz commented Mar 30, 2019

image

@afc163
Copy link
Member

afc163 commented Mar 30, 2019

.ant-pagination-item a {
-   margin: 0 6px;
+   padding: 0 6px;
+   display: block;
    color: rgba(0,0,0,0.65);
    text-decoration: none;
    transition: none;
}

Could we change styles in this way?

@tylik1
Copy link
Author

tylik1 commented Mar 30, 2019

Next and previous buttons are already styled properly. They also have height:100%
Though still border is applied to li and if you hover on the very edge and click - it will hover, but won't trigger click.
This border issue is minor though

@afc163 afc163 assigned afc163 and unassigned zombieJ May 7, 2019
afc163 added a commit that referenced this issue May 7, 2019
link take all space inside li

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

Successfully merging a pull request may close this issue.

5 participants