diff --git a/components/drawer/DrawerPanel.tsx b/components/drawer/DrawerPanel.tsx index b422af366a..cd2054c881 100644 --- a/components/drawer/DrawerPanel.tsx +++ b/components/drawer/DrawerPanel.tsx @@ -157,18 +157,7 @@ const DrawerPanel: React.FC = (props) => { }, [footer, footerStyle, prefixCls]); if (spinProps?.spinning) { - return ( - - ); + return ; } return ( diff --git a/components/drawer/__tests__/__snapshots__/Drawer.test.tsx.snap b/components/drawer/__tests__/__snapshots__/Drawer.test.tsx.snap index 6bd0196a06..c8776a0ab7 100644 --- a/components/drawer/__tests__/__snapshots__/Drawer.test.tsx.snap +++ b/components/drawer/__tests__/__snapshots__/Drawer.test.tsx.snap @@ -27,7 +27,6 @@ exports[`Drawer Drawer loading have a spinner 1`] = ` aria-busy="true" aria-live="polite" class="ant-spin ant-spin-spinning" - style="height: 100%; display: flex; justify-content: center; align-items: center;" > {} // =============================== Base =============================== const genDrawerStyle: GenerateStyle = (token) => { const { + antCls, borderRadiusSM, componentCls, zIndexPopup, @@ -147,6 +148,13 @@ const genDrawerStyle: GenerateStyle = (token) => { overflow: 'auto', background: colorBgElevated, pointerEvents: 'auto', + [`${antCls}-spin`]: { + width: '100%', + height: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + }, }, // Header