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