优化FormBuilder
parent
2b7da6d088
commit
45bcba0f77
|
|
@ -37,12 +37,17 @@ const FormBuilder = (props) => {
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
getPageWidth();
|
getPageWidth();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
if (showActionButtons) {
|
||||||
window.addEventListener("resize", getPageWidth);
|
window.addEventListener("resize", getPageWidth);
|
||||||
|
}
|
||||||
return () => {
|
return () => {
|
||||||
|
if (showActionButtons) {
|
||||||
window.removeEventListener("resize", getPageWidth);
|
window.removeEventListener("resize", getPageWidth);
|
||||||
|
}
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
};
|
};
|
||||||
}, []);
|
}, [showActionButtons]);
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue