Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for V3: Prevent a selected option from being removed when isDisabled is passed #302

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

lschlesinger
Copy link

@lschlesinger lschlesinger commented Nov 10, 2023

Issue: on chakra-react-select v3 users can remove selected options when isDisabled is passed using

Reported here for v4: #168
Fixed here for > v4: #169

This PR aims to fix this issue for v3

@lschlesinger lschlesinger changed the base branch from main to v3 November 10, 2023 09:07
@lschlesinger lschlesinger marked this pull request as ready for review November 10, 2023 09:08
// When disabled, react-select sets the pointer-state to none which prevents
// the `not-allowed` cursor style from chakra from getting applied to the
// Control when it is disabled
pointerEvents: "auto",
};
Copy link
Owner

@csandman csandman Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm cool with this change, but can you add the rest of my change from the original PR so the hover styling matches the rest of the disabled chakra components?

Suggested change
};
...(isDisabled ? { cursor: "not-allowed" } : {}),
};

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course, sorry I missed it earlier! Added now 👍

Copy link
Owner

@csandman csandman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me, can you make the one change I requested first though? Just want this to better line up with the intent of my original change!

@lschlesinger
Copy link
Author

@csandman Thanks for the feedback, I've changed it now.

@csandman csandman merged commit 73cec75 into csandman:v3 Nov 16, 2023
1 check passed
@csandman
Copy link
Owner

Great, looks good! Merged and released in v3.3.10!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants