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

Fixed multiple checkboxes mistakenly marked as required if a Field is marked as required. #1312

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

AlexSkrypnyk
Copy link
Contributor

This needs UIKit change to be merged civictheme/uikit#405

Use case: webform field with multiple checkboxes marked as required makes all checkboxes required.

@richardgaunt richardgaunt added the State: Needs review Pull requests needs a review from assigned developers label Oct 6, 2024
@@ -191,6 +191,8 @@ function civictheme_preprocess_fieldset__form_element__civictheme_field__checkbo
'id' => Html::cleanCssIdentifier($element['#id'] . '-' . $value),
'is_checked' => is_array($element['#default_value']) ? in_array($value, $element['#default_value']) : $element['#default_value'] == $value,
'is_disabled' => isset($element['#attributes']['disabled']),
// Checkboxes controls with a group cannot be required by definition.
'is_required' => FALSE,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlexSkrypnyk If I am understanding you, you are saying you shouldn't compel a user to check all the checkboxes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’m saying that currently all of the checkboxes are marked required if the field has required attribute. But that required attribute means “at least one checkbox” is required rather than “all checkboxes are required”. Of course, this is in the context of “checkboxes” element only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: Needs review Pull requests needs a review from assigned developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants