Ant Design modal form encountered the problem of page scroll bar failure after opening the secondary pop-up box and closing the two pop-up boxes.
Reason:
when the modal form pop-up box is opened, it will add style = "width: Calc (100% - 15px) to the body label; overflow: hidden;” Code> inline style to hide the scroll bar of the page. When closed, this style will be cleared to restore the scroll bar. Open a secondary modal form pop-up box in the modal form pop-up box. After closing the two pop-up boxes, there will be a problem that the style on the body label is not cleaned up, resulting in the problem that the page scroll bar is not restored.
The solution is as follows:
after the first level cartridge modal form is closed, clean up the style added to the body. The specific code is as follows:
<ModalForm
modalProps={{
afterClose: () => {
if (document.getElementsByTagName('body')[0].hasAttribute('style')) {
document.getElementsByTagName('body')[0].removeAttribute('style');
}
},
}}>
</ModalForm>
Read More:
- Using UMI plugin keep alive to realize keep alive state storage in UMI Ant Design
- Solve the problem of showing unregistered (unknown custom element) when importing components into Ant Design Pro
- Ant Design proformdigit fieldprops limits the number of decimal places entered
- Solution of flash screen caused by OpenGL in MFC environment
- Error reported by ISE simulator: ERROR:Simulator : 861 – failed to link the design solution
- Ant Design ‘cross env’ is not an internal or external command, nor is it an error reporting problem for a runnable program
- spring boot-beans in application context form a cycle
- Solution to error reporting on the client caused by adding fields on the CXF server
- Caused by: java.net.SocketException : connection reset or caused by: java.sql.SQLRecoverableException solve
- In the HTML page request Ajax times 400 error, solve Yii submit post form 400 error, and Ajax post request 400 problem (example code)
- Error in DESeqDataSet(se, design = design, ignoreRank) : some values in assay are negative
- Ant Design upload listtype = “picture card” realizes multi image upload and click preview image encapsulation
- Solution to error report of Jackson coordinate introduced by spring
- The solution of flicker and no refresh caused by OpenGL + MFC
- Solution of no response of progress bar in MFC program
- Uni-app: How to Solve Native scroll events fail
- ERP failure: Error when opening an RFC connection
- Opening feature class.General function failure
- Caused by: java.io.IOException: APR error: -730053
- Solution to error opening trace file: no such file or directory (2) in Android