-
Notifications
You must be signed in to change notification settings - Fork 62
FIX CHECKBOX_GROUP #182
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 CHECKBOX_GROUP #182
Conversation
| this.#handleRequired(); | ||
| } | ||
|
|
||
| #handleRequired() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's necessary to run the same code in connect and onChange
| rbui__form_field_target: "input", | ||
| rbui__checkbox_group_target: "checkbox", | ||
| action: "input->rbui--form-field#onInput invalid->rbui--form-field#onInvalid change->rbui--checkbox-group#onChange" | ||
| action: "change->rbui--checkbox-group#onChange change->rbui--form-field#onInput invalid->rbui--form-field#onInvalid" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the correct use of actions here is change, not input
change->rbui--checkbox-group#onChange needs to run before the validation of change->rbui--form-field#onInput and invalid->rbui--form-field#onInvalid
| data: { | ||
| rbui__form_field_target: "input", | ||
| action: "input->rbui--form-field#onInput invalid->rbui--form-field#onInvalid" | ||
| action: "change->rbui--form-field#onInput invalid->rbui--form-field#onInvalid" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same situation... change instead of input for radio
| #getValidationMessage() { | ||
| const input = this.inputTarget; | ||
| const defaultMessage = this.inputTarget.validationMessage; | ||
| let errorMessage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more understandable code here
|
closes #181 |
BEFORE

AFTER
