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

Checkbox - add validation if no choice is selected #1316

Merged

Conversation

Srenky
Copy link
Contributor

@Srenky Srenky commented Oct 8, 2023

Closes #1257 (first part)

Adds validation logic for checkbox component that notifies the user if no choice has been selected and presses enter (enforces that at least one choice must be selected)

image

Added unit test for new logic. Also needed to edit a few existing ones since they were failing because of this new feature.

@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
packages/checkbox/src/index.mts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

Copy link
Owner

@SBoudrias SBoudrias left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Did a review pass and left you some comments. Let me know if you need more clairification!

packages/checkbox/src/index.mts Outdated Show resolved Hide resolved
packages/checkbox/src/index.mts Outdated Show resolved Hide resolved
packages/checkbox/src/index.mts Outdated Show resolved Hide resolved
@Srenky
Copy link
Contributor Author

Srenky commented Oct 14, 2023

FYI @SBoudrias, I started working on the second part of the issue (adding min and max options with validation). I'll create a new PR after this one is merged.

Copy link
Owner

@SBoudrias SBoudrias left a comment

Choose a reason for hiding this comment

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

Great! Thanks for following up on all the comments. I'll get this merge ASAP

@SBoudrias SBoudrias merged commit 6fb4d9c into SBoudrias:master Oct 15, 2023
12 checks passed
@Srenky Srenky deleted the checkbox-validation-no-choice-selected branch October 16, 2023 17:58
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.

Add validate function to checkbox
2 participants