-
Notifications
You must be signed in to change notification settings - Fork 555
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
CheckboxInput does not display any InvalidHint to the user #2400
Comments
Thanks for reaching out. I will look into this and get back to you if I need more info (or have a solution). |
Hey @r-bartolomei, I just put up a PR that would solve this issue over at #2423. Would love to get your feedback on whether the current styling (checkbox text turned to red) is expected for you if there's an alternative. |
Hey @ewanharris. If the red border is not possible then the checkbox text on default colour I think might look better because it would align with the rest of mandatory fields (if any) as they would not have the text content on red. |
Sorry for the delay @r-bartolomei, we've chatted about this and after a little investigation I think we might do the following:
|
### Changes Wrap the `CheckBoxInput` in `InputWrapper` to allow for providing feedback as to what is wrong when a user clicks submit without the checkbox being selected. Below is an example of what this looks like, rather than highlight using a border like other fields we change the text to red. **This image is outdated see below** <img width="301" alt="Screenshot 2023-08-04 at 12 03 18" src="https://github.com/auth0/lock/assets/8705251/cb346e0a-5d3e-4d24-87e8-b037b99dd34b"> I did also see what it looked like without the red text, which is a little less obvious. <img width="300" alt="Screenshot 2023-08-04 at 11 59 11" src="https://github.com/auth0/lock/assets/8705251/688ee97f-cd17-4375-80bb-b00d252529cb"> This is if we add a border around the entire element like the other components ![Screenshot 2023-08-04 at 11 05 07](https://github.com/auth0/lock/assets/8705251/a3eea2dc-c8ee-4e90-b5b9-f7fa68e3d143) I did also try a border/outline around the checkbox element but it looked bad due to inability to set the border radiu Happy to change this up if there's a general preference that looks better. Current status: Invalid hint text provided ![Invalid hint text is red and aligned with checkbox text](https://github.com/auth0/lock/assets/8705251/9ec1f0d1-9d60-46fd-b38b-9165dbc9ae71) No invalid hint text provided ![Checkbox text is red](https://github.com/auth0/lock/assets/8705251/c9452810-11f3-43e3-85e6-bc4298f5d904) ### References #2400 ### Testing <!-- Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors. --> * [x] This change adds unit test coverage * [ ] This change adds integration test coverage * [ ] This change has been tested on the latest version of the platform/language ### Checklist * [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) * [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md) * [x] All code quality tools/guidelines have been run/followed * [x] All relevant assets have been compiled
Hey @r-bartolomei, this change shipped today in version |
@ewanharris Thank you for fixing it! |
Checklist
Description
If you use
additionalSignUpFields
option with atype: 'checkbox'
that has avalidator
function (https://auth0.com/docs/libraries/lock/lock-configuration#checkbox-field), thesrc/ui/input/checkbox_input.jsx
is not wrapped within anInputWrap
component but within a simple div and as a result, theinvalidHint
will never be displayed when you press on the Sign Up button.Reproduction
with the below code:
because of
valid: value === 'true',
the field becomes mandatory (the user needs to check it) before being able to finish the Sign Up.But because of the missing
InputWrap
within theCheckboxInput
(src/ui/input/checkbox_input.jsx
), no error message will be shown to the user if the checkbox is not checked and the user will not know why he can't go through with the sign up process.As a comparison,
src/ui/input/text_input.jsx
andsrc/ui/input/select_input.jsx
have the elements wrapped within theInputWrap
and those components are displaying theinvalidHint
correctly.Additional context
No response
Lock version
"auth0-lock": "12.0.2"
Which browsers have you tested in?
Chrome
The text was updated successfully, but these errors were encountered: