Skip to content
Discussion options

You must be logged in to vote

@RSchneider94 : The logic can be simplified by just using custom "onChange" for CheckboxGroup component.

For example:

<CheckboxGroup
                onChange={(e) => {
                  if (
                    e.includes("view-documents") &&
                    e.includes("manage-documents")
                  ) {
                    onChange(["manage-documents"]);
                  } else {
                    onChange(e);
                  }
                }}
                {...newField}
              >

Working demo: https://codesandbox.io/s/nervous-saha-80b1ho?file=/src/App.tsx

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@RSchneider94
Comment options

Answer selected by bluebill1049
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants