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

Disabled Button type="link" does not have cursor: not-allowed style #30043

Closed
1 task done
ghost opened this issue Apr 7, 2021 · 3 comments · Fixed by #30197
Closed
1 task done

Disabled Button type="link" does not have cursor: not-allowed style #30043

ghost opened this issue Apr 7, 2021 · 3 comments · Fixed by #30197

Comments

@ghost
Copy link

ghost commented Apr 7, 2021

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

Reproduction link

https://stackblitz.com/edit/react-ndjap4?file=index.js

Steps to reproduce

  1. Insert Button component a set props type="link" and href="http://google.com"
  2. Hover over the button

What is expected?

Button type="link" must have cursor: not-allowed when href prop is set

What is actually happening?

The button has a default cursor

Environment Info
antd 4.15.0
React 16.14.0
System WIndows 10
Browser Chrome 89.0.4389.114
@jameslahm
Copy link
Contributor

The reason should be that pointer-events: none will be applied to <Button disabled type="link" href="http://google.com"> Link Button w href set </Button>, which will disable all mouse interactions with that element and thus cursor style will not work. You could add a wrapper for the button, and apply cursor style to the wrapper, here is a demo.

@ghost
Copy link
Author

ghost commented Apr 7, 2021

I see. Thanks for the clarification. But could it be handled by antd (adding a wrapper)?

@jameslahm
Copy link
Contributor

I am not sure. I think it's better to control cursor style ourselves. But if the antd team think it's reasonable to add a wrapper internally, I'm very pleased to make a pr 😂.

afc163 added a commit that referenced this issue Apr 18, 2021
afc163 added a commit that referenced this issue Apr 18, 2021
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 a pull request may close this issue.

1 participant