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

feat(react): add indeterminate support to checkbox #1621

Merged
merged 9 commits into from
Aug 13, 2024

Conversation

chornonoh-vova
Copy link
Contributor

closes: #479

@chornonoh-vova chornonoh-vova requested review from a team as code owners August 7, 2024 08:48
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1621.d15792l1n26ww3.amplifyapp.com

Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

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

This is a great start!

As an overview for testing, please take a look at the testing strategies guidelines as there's a few things we're missing.

Additionally, it's not documented (yet) but we're capturing screenshots for all interactive elements. We should include the indeterminate checkbox as an additional state to capture here: https://github.com/dequelabs/cauldron/blob/develop/packages/react/src/components/Checkbox/screenshots.e2e.tsx

packages/react/src/components/Checkbox/index.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Checkbox/index.tsx Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/react/src/components/Checkbox/Checkbox.test.tsx Outdated Show resolved Hide resolved
@scurker
Copy link
Member

scurker commented Aug 7, 2024

One additional thing that I'm realizing is we're not matching what native checkboxes do.

A checkbox can have an indeterminate state and be checked / unchecked. When clicked, the indeterminate state is removed and the checked value is flipped from its current value so we will likely want to match that behavior as our current checkbox component isn't "controlled".

@chornonoh-vova chornonoh-vova requested a review from a team as a code owner August 8, 2024 09:57
scurker
scurker previously approved these changes Aug 8, 2024
Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

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

At a high level, this looks good - thanks for making changes. I will give it a final pass over tomorrow morning.

Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

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

Very very minor nit, otherwise looks good!

packages/react/src/components/Checkbox/index.tsx Outdated Show resolved Hide resolved
Co-authored-by: Jason <jason@scurker.com>
@shawnsharpDQ
Copy link

Is there anything we can do for the visibility of the disabled indeterminate state?
image
compared to the disabled checked
image

shawnsharpDQ
shawnsharpDQ previously approved these changes Aug 12, 2024
@chornonoh-vova chornonoh-vova merged commit c49bfd2 into develop Aug 13, 2024
8 checks passed
@chornonoh-vova chornonoh-vova deleted the feature/479-checkbox-indeterminate-support branch August 13, 2024 17:40
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.

Add indeterminate support to <Checkbox />
3 participants