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

Bug: Default checked checkboxes on layers such as Dialogs don't appear #267

Open
steppy452 opened this issue Nov 29, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@steppy452
Copy link
Contributor

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

Just the check inside the checkbox doesn't appear when a checkbox is checked by default, and on a layer such as a dialog. I've also observed this behavior for menus as well.
image

If you uncheck, and check again. it appear correctly.

Expected behavior

Should appear with check:
image

Minimal reproduction of the problem with instructions

https://codesandbox.io/p/devbox/jx59th

What is the motivation / use case for changing the behavior?

to use checkboxes in dialogs and menus

Environment


Libs:
- react version: X.Y.Z
- reablocks version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

@steppy452 steppy452 added the bug Something isn't working label Nov 29, 2024
@amcdnl
Copy link
Member

amcdnl commented Dec 2, 2024

This issue is related to the initial path animation. Framer motion is trying to trace a SVG path but the SVG hasn't rendered so the path length is 0.

Removing the initial seems to fix it ( validating the problem ) but is not a viable fix given it will break other spots initial animation. Furthermore, if you don't use a callback in the dialog children function it also works further highlighting the issue.

The solution is not going to be fun because you need to draw/measure a hidden svg of the checkbox to get length. Given the frequency of a checkbox, i dont think the performance trade off is worth the animation. Maybe we explore an alternative approach for the check like CSS or something.

@amcdnl
Copy link
Member

amcdnl commented Dec 3, 2024

PR: #268

amcdnl added a commit that referenced this issue Feb 7, 2025
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

No branches or pull requests

2 participants