Skip to content

Commit f045034

Browse files
authored
fix(Upload): keep Dragger style height when height prop is unset (#59319)
1 parent 599b251 commit f045034

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎components/upload/Dragger.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
import { isNonNullable } from '@rc-component/util';
23

34
import type { UploadProps } from './interface';
45
import type { UploadRef } from './Upload';
@@ -12,7 +13,10 @@ type DraggerType = (<T = any>(
1213

1314
const Dragger = React.forwardRef<UploadRef, DraggerProps<any>>((props, ref) => {
1415
const { style, height, hasControlInside = false, children, ...restProps } = props;
15-
const mergedStyle: React.CSSProperties = { ...style, height };
16+
const mergedStyle: React.CSSProperties = {
17+
...style,
18+
...(isNonNullable(height) && { height }),
19+
};
1620
return (
1721
<Upload
1822
ref={ref}

0 commit comments

Comments
 (0)