mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-12 20:43:11 +08:00
fix ummount issue, #6976
This commit is contained in:
parent
6eff4bd02a
commit
b54a70bc8e
@ -38,22 +38,24 @@ export default class Card extends Component<CardProps> {
|
|||||||
if (this.resizeEvent) {
|
if (this.resizeEvent) {
|
||||||
this.resizeEvent.remove();
|
this.resizeEvent.remove();
|
||||||
}
|
}
|
||||||
|
(this.updateWiderPadding as any).cancel();
|
||||||
}
|
}
|
||||||
@throttleByAnimationFrameDecorator()
|
@throttleByAnimationFrameDecorator()
|
||||||
updateWiderPadding() {
|
updateWiderPadding() {
|
||||||
if (this.container) {
|
if (!this.container) {
|
||||||
// 936 is a magic card width pixer number indicated by designer
|
return;
|
||||||
const WIDTH_BOUDARY_PX = 936;
|
}
|
||||||
if (this.container.offsetWidth >= WIDTH_BOUDARY_PX && !this.state.widerPadding) {
|
// 936 is a magic card width pixer number indicated by designer
|
||||||
this.setState({ widerPadding: true }, () => {
|
const WIDTH_BOUDARY_PX = 936;
|
||||||
this.updateWiderPaddingCalled = true; // first render without css transition
|
if (this.container.offsetWidth >= WIDTH_BOUDARY_PX && !this.state.widerPadding) {
|
||||||
});
|
this.setState({ widerPadding: true }, () => {
|
||||||
}
|
this.updateWiderPaddingCalled = true; // first render without css transition
|
||||||
if (this.container.offsetWidth < WIDTH_BOUDARY_PX && this.state.widerPadding) {
|
});
|
||||||
this.setState({ widerPadding: false }, () => {
|
}
|
||||||
this.updateWiderPaddingCalled = true; // first render without css transition
|
if (this.container.offsetWidth < WIDTH_BOUDARY_PX && this.state.widerPadding) {
|
||||||
});
|
this.setState({ widerPadding: false }, () => {
|
||||||
}
|
this.updateWiderPaddingCalled = true; // first render without css transition
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
saveRef = (node: HTMLDivElement) => {
|
saveRef = (node: HTMLDivElement) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user