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: loading circle button can handle pointer events. #16063

Merged
merged 3 commits into from
Apr 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/button/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ exports[`renders ./components/button/demo/icon.md correctly 1`] = `
`;

exports[`renders ./components/button/demo/loading.md correctly 1`] = `
<span>
<div>
<button
class="ant-btn ant-btn-primary ant-btn-loading"
type="button"
Expand Down Expand Up @@ -746,7 +746,7 @@ exports[`renders ./components/button/demo/loading.md correctly 1`] = `
</svg>
</i>
</button>
</span>
</div>
`;

exports[`renders ./components/button/demo/multiple.md correctly 1`] = `
Expand Down
4 changes: 2 additions & 2 deletions components/button/demo/loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class App extends React.Component {

render() {
return (
<span>
<div>
Copy link
Member

@afc163 afc163 Apr 13, 2019

Choose a reason for hiding this comment

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

Any reasons to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A span tag contains too much tags that is weird.

<Button type="primary" loading>
Loading
</Button>
Expand All @@ -49,7 +49,7 @@ class App extends React.Component {
<br />
<Button shape="circle" loading />
<Button type="primary" shape="circle" loading />
</span>
</div>
);
}
}
Expand Down
7 changes: 5 additions & 2 deletions components/button/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,17 @@
}
}

&&-loading {
position: relative;
pointer-events: none;
}

&&-loading::before {
display: block;
}

&&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) {
position: relative;
padding-left: 29px;
pointer-events: none;
.@{iconfont-css-prefix}:not(:last-child) {
margin-left: -14px;
}
Expand Down