Skip to content

Commit 258573a

Browse files
authored
chore: improve closablePlacement (ant-design#56611)
1 parent 3c9bb68 commit 258573a

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

components/drawer/DrawerPanel.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,11 @@ const DrawerPanel: React.FC<DrawerPanelProps> = (props) => {
117117
});
118118

119119
const closablePlacement = React.useMemo<'start' | 'end' | undefined>(() => {
120-
const mergedClosableVal = closable ?? contextClosable;
121-
if (mergedClosableVal === false) {
120+
const merged = closable ?? contextClosable;
121+
if (merged === false) {
122122
return undefined;
123123
}
124-
if (
125-
typeof mergedClosableVal === 'object' &&
126-
mergedClosableVal &&
127-
mergedClosableVal.placement === 'end'
128-
) {
124+
if (typeof merged === 'object' && merged?.placement === 'end') {
129125
return 'end';
130126
}
131127
return 'start';

0 commit comments

Comments
 (0)