Skip to content

Commit ed24ffe

Browse files
committed
Fix the height setting on the control
1 parent b2eb00e commit ed24ffe

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/chakra-components/control.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,23 @@ const Control = <
4545

4646
const size = useSize(sizeProp);
4747
const {
48-
field: { h: minH, ...fieldStyles },
48+
field: { height, h, ...fieldStyles },
4949
} = useMultiStyleConfig("Input", {
5050
size,
5151
variant,
5252
focusBorderColor,
5353
errorBorderColor,
5454
});
5555

56+
/**
57+
* `@chakra-ui/theme@3.2.0` introduced a breaking change that switched from using `h` to `height` for the Input sizing.
58+
*
59+
* We need to keep checking for either to maintain backwards compatibility.
60+
*
61+
* @see {@link https://github.com/chakra-ui/chakra-ui/releases/tag/%40chakra-ui%2Ftheme%403.2.0}
62+
*/
63+
const minH = height || h;
64+
5665
const initialSx: SystemStyleObject = {
5766
...fieldStyles,
5867
position: "relative",
@@ -62,6 +71,7 @@ const Control = <
6271
flexWrap: "wrap",
6372
padding: 0,
6473
overflow: "hidden",
74+
height: "auto",
6575
minH,
6676
...(isDisabled ? { pointerEvents: "none" } : {}),
6777
};

0 commit comments

Comments
 (0)