Skip to content

Checkbox - add validation if no choice is selected#1316

Merged
SBoudrias merged 6 commits intoSBoudrias:masterfrom
Srenky:checkbox-validation-no-choice-selected
Oct 15, 2023
Merged

Checkbox - add validation if no choice is selected#1316
SBoudrias merged 6 commits intoSBoudrias:masterfrom
Srenky:checkbox-validation-no-choice-selected

Conversation

@Srenky
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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!

Comment thread packages/checkbox/src/index.mts Outdated
Comment thread packages/checkbox/src/index.mts Outdated
Comment thread packages/checkbox/src/index.mts Outdated
@Srenky
Copy link
Copy Markdown
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.

Comment thread packages/checkbox/src/index.mts Outdated
Copy link
Copy Markdown
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
@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