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

Add isOptional to Checkbox #1773

Merged
merged 20 commits into from
May 25, 2023
Merged

Add isOptional to Checkbox #1773

merged 20 commits into from
May 25, 2023

Conversation

jordankoschei-okta
Copy link
Contributor

This PR adds isOptional to Checkbox. In order to make this happen, I needed to use the required prop on FormControlLabel, which necessitated updating to the latest MUI.

@edburyenegren-okta
Copy link
Contributor

  1. Should this be wrapped by Field instead? That handles the interactions for our other form fields, though I don't think @KevinGhadyani-Okta has refactored them all.

  2. The resulting UI deviates from our other fields, which don't mark required fields as such, instead marking optional fields.

Screenshot 2023-05-04 at 11 29 44 AM

@edburyenegren-okta
Copy link
Contributor

Ah, here's the WIP PR I was thinking of: #1762

@jordankoschei-okta
Copy link
Contributor Author

Okay, excellent, I can redo this based on the Field refactoring work.

I don't think there's an elegant way of indicating "optional" on a single checkbox, especially since the vast majority of checkboxes will be optional — any thoughts on this?

@jordankoschei-okta
Copy link
Contributor Author

I made some changes:

  1. The asterisk has been replaced with "(Required)"
  2. The required text is customizable, for i18n support
  3. isOptional is now isRequired for checkboxes

Copy link
Contributor

@KevinGhadyani-Okta KevinGhadyani-Okta left a comment

Choose a reason for hiding this comment

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

This PR's ready to go, but now we need to integrate with the translation code.

@KevinGhadyani-Okta KevinGhadyani-Okta merged commit 49c90cf into develop May 25, 2023
@KevinGhadyani-Okta KevinGhadyani-Okta deleted the jk/OKTA-606993 branch May 25, 2023 18:48
This pull request was closed.
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.

3 participants