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

🐛 Checkbox - Prob click on a controlled way #175

Closed
Tracked by #2437
AntoLC opened this issue Sep 29, 2023 · 0 comments · Fixed by #177
Closed
Tracked by #2437

🐛 Checkbox - Prob click on a controlled way #175

AntoLC opened this issue Sep 29, 2023 · 0 comments · Fixed by #177
Labels
bug Something isn't working

Comments

@AntoLC
Copy link
Contributor

AntoLC commented Sep 29, 2023

Bug Report

Problematic Behavior

On @openfun/cunningham-react@1.3.0.

In a controlled way, the checkbox doesn't change state (or change it 2 times on a row) when we click on it, the bug occurs when the card containing the checkbox is clickable.

A codesandbox was made to show the problem:
https://codesandbox.io/p/sandbox/react-ts-cunningham-prob-checkbox-controlled-7523d9

@AntoLC AntoLC added the bug Something isn't working label Sep 29, 2023
NathanVss added a commit that referenced this issue Sep 29, 2023
When clicking on the checkmark it was trigerring two onChange on parent
elements, thus causing double toggling ( which means revert to the initial
value ) in some controlled way approaches ( see the added test ).

Fixes #175
NathanVss added a commit that referenced this issue Sep 29, 2023
When clicking on the checkmark it was trigerring two onChange on parent
elements, thus causing double toggling ( which means revert to the initial
value ) in some controlled way approaches ( see the added test ).

Fixes #175
NathanVss added a commit that referenced this issue Oct 2, 2023
When clicking on the checkmark it was trigerring two onChange on parent
elements, thus causing double toggling ( which means revert to the initial
value ) in some controlled way approaches ( see the added test ).

Fixes #175
NathanVss added a commit that referenced this issue Oct 2, 2023
When clicking on the checkmark it was trigerring two onChange on parent
elements, thus causing double toggling ( which means revert to the initial
value ) in some controlled way approaches ( see the added test ).

Fixes #175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant