Compare commits

...

2 Commits

Author SHA1 Message Date
thinkasany
67c918f880 chore: skip list vertical demo image (#56900) 2026-02-09 10:55:18 +08:00
thinkasany
1de95db5c1 chore: improve drawer (#56906)
* chore: improve drawer

* Update components/drawer/Drawer.tsx

Co-authored-by: lijianan <574980606@qq.com>
Signed-off-by: 遇见同学 <1875694521@qq.com>

---------

Signed-off-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: lijianan <574980606@qq.com>
2026-02-09 09:33:19 +08:00
2 changed files with 23 additions and 23 deletions

View File

@@ -60,14 +60,20 @@ export interface DrawerProps
*/
destroyOnHidden?: boolean;
mask?: MaskType;
focusable?: FocusableConfig;
}
const defaultPushState: PushState = { distance: 180 };
const DEFAULT_PUSH_STATE: PushState = { distance: 180 };
const DEFAULT_SIZE = 378;
const MOTION_CONFIG: CSSMotionProps = {
motionAppear: true,
motionEnter: true,
motionLeave: true,
motionDeadline: 500,
} as const;
const Drawer: React.FC<DrawerProps> & {
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
} = (props) => {
@@ -78,7 +84,7 @@ const Drawer: React.FC<DrawerProps> & {
height,
width,
mask: drawerMask,
push = defaultPushState,
push = DEFAULT_PUSH_STATE,
open,
afterOpenChange,
onClose,
@@ -157,18 +163,12 @@ const Drawer: React.FC<DrawerProps> & {
// =========================== Motion ===========================
const maskMotion: CSSMotionProps = {
motionName: getTransitionName(prefixCls, 'mask-motion'),
motionAppear: true,
motionEnter: true,
motionLeave: true,
motionDeadline: 500,
...MOTION_CONFIG,
};
const panelMotion: RcDrawerProps['motion'] = (motionPlacement) => ({
motionName: getTransitionName(prefixCls, `panel-motion-${motionPlacement}`),
motionAppear: true,
motionEnter: true,
motionLeave: true,
motionDeadline: 500,
...MOTION_CONFIG,
});
// ============================ Refs ============================
@@ -205,6 +205,17 @@ const Drawer: React.FC<DrawerProps> & {
props: mergedProps,
});
const drawerClassName = clsx(
{
'no-mask': !mergedMask,
[`${prefixCls}-rtl`]: direction === 'rtl',
},
rootClassName,
hashId,
cssVarCls,
mergedClassNames.root,
);
// ========================== Warning ===========================
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Drawer');
@@ -237,17 +248,6 @@ const Drawer: React.FC<DrawerProps> & {
);
}
const drawerClassName = clsx(
{
'no-mask': !mergedMask,
[`${prefixCls}-rtl`]: direction === 'rtl',
},
rootClassName,
hashId,
cssVarCls,
mergedClassNames.root,
);
return (
<ContextIsolator form space>
<zIndexContext.Provider value={contextZIndex}>

View File

@@ -1,5 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('List image', () => {
imageDemoTest('list', { skip: ['loadmore.tsx'] });
imageDemoTest('list', { skip: ['loadmore.tsx', 'vertical.tsx'] });
});