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

If you set the href attribute, the disabled style does not take effect #39452

Closed
leo220yuyaodog opened this issue Dec 10, 2022 · 5 comments · Fixed by #39456
Closed

If you set the href attribute, the disabled style does not take effect #39452

leo220yuyaodog opened this issue Dec 10, 2022 · 5 comments · Fixed by #39456
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@leo220yuyaodog
Copy link

leo220yuyaodog commented Dec 10, 2022

Reproduction link

Edit on CodeSandbox

Steps to reproduce

在button 的disable={true} 时,设置href,此时disable样式不生效

What is expected?

Actually, I found this issue #35952 is similar. But in anted 5.0.5, the problem seems to have resurfaced and is not fully fixed. What I expect is that when the button is not just a link type, setting disabled will take effect as well as the button type.

What is actually happening?

button设置href后,diabled样式不生效

Environment Info
antd 5.0.5
React 18.2.0
System Windows 11 22623.1028
Browser 107.0.1418.52 (正式版本) (64 位)
@leo220yuyaodog leo220yuyaodog changed the title button 设置有href时,当disabled 的时候,没有disabled的样式 If you set the href attribute, the dsiabled style does not take effect Dec 10, 2022
@leo220yuyaodog leo220yuyaodog changed the title If you set the href attribute, the dsiabled style does not take effect If you set the href attribute, the disabled style does not take effect Dec 10, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2022

@BoyYangzai
Copy link
Contributor

I tried to solve it,and passed all tests,I don't know if it met the author's expectations. qwq

@leo220yuyaodog
Copy link
Author

I tried to solve it,and passed all tests,I don't know if it met the author's expectations. qwq

Thank you very much! As the example in Reproduction link.
The left button is disabled, but now it is not has disabled style. I expect it has the same sytle as the middle button.
image

@BoyYangzai
Copy link
Contributor

@MadCcc MadCcc added 🐛 Bug Ant Design Team had proved that this is a bug. and removed 🐛 Bug Ant Design Team had proved that this is a bug. labels Dec 12, 2022
@MadCcc
Copy link
Member

MadCcc commented Dec 12, 2022

#35975
new feature in 4.21, and lost in v5

@MadCcc MadCcc added the 🐛 Bug Ant Design Team had proved that this is a bug. label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants