Skip to content

Commit

Permalink
fix: add Drawer Spin className (#48857)
Browse files Browse the repository at this point in the history
* fix: add Spin className

* fix: update snap
  • Loading branch information
li-jia-nan committed May 10, 2024
1 parent 6da1ad1 commit 32b89e6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
7 changes: 6 additions & 1 deletion components/drawer/DrawerPanel.tsx
Expand Up @@ -157,7 +157,12 @@ const DrawerPanel: React.FC<DrawerPanelProps> = (props) => {
}, [footer, footerStyle, prefixCls]);

if (spinProps?.spinning) {
return <Spin {...spinProps} />;
return (
<Spin
{...spinProps}
className={classNames(spinProps.className, `${prefixCls}-content-spin`)}
/>
);
}

return (
Expand Down
Expand Up @@ -26,7 +26,7 @@ exports[`Drawer Drawer loading have a spinner 1`] = `
<div
aria-busy="true"
aria-live="polite"
class="ant-spin ant-spin-spinning"
class="ant-spin ant-spin-spinning ant-drawer-content-spin"
>
<span
class="ant-spin-dot ant-spin-dot-spin"
Expand Down
Expand Up @@ -2816,7 +2816,7 @@ Array [
<div
aria-busy="true"
aria-live="polite"
class="ant-spin ant-spin-spinning"
class="ant-spin ant-spin-spinning ant-drawer-content-spin"
>
<span
class="ant-spin-dot ant-spin-dot-spin"
Expand Down
3 changes: 1 addition & 2 deletions components/drawer/style/index.ts
Expand Up @@ -28,7 +28,6 @@ export interface DrawerToken extends FullToken<'Drawer'> {}
// =============================== Base ===============================
const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
const {
antCls,
borderRadiusSM,
componentCls,
zIndexPopup,
Expand Down Expand Up @@ -148,7 +147,7 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
overflow: 'auto',
background: colorBgElevated,
pointerEvents: 'auto',
[`${antCls}-spin`]: {
[`${componentCls}-content-spin`]: {
width: '100%',
height: '100%',
display: 'flex',
Expand Down

0 comments on commit 32b89e6

Please sign in to comment.