Skip to content

Commit 7bfb096

Browse files
committed
fix to prevent a selected option from being removed when isDisabled is passed in v3
1 parent 3f31a68 commit 7bfb096

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/chakra-components/containers.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ export const SelectContainer = <
3131
const initialStyles: SystemStyleObject = {
3232
position: "relative",
3333
direction: isRtl ? "rtl" : undefined,
34-
// When disabled, react-select sets the pointer-state to none which prevents
35-
// the `not-allowed` cursor style from chakra from getting applied to the
36-
// Control when it is disabled
37-
pointerEvents: "auto",
3834
};
3935

4036
const sx: SystemStyleObject = chakraStyles?.container

src/chakra-components/control.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const Control = <
5050
overflow: "hidden",
5151
height: "auto",
5252
minHeight: heights[size as Size],
53+
...(isDisabled ? { pointerEvents: "none" } : {}),
5354
};
5455

5556
const sx: SystemStyleObject = chakraStyles?.control

0 commit comments

Comments
 (0)